Commit 8945570 1 parent 8d087ac commit 8945570 Copy full SHA for 8945570
File tree 2 files changed +21
-1
lines changed
src/main/java/dev/vaziak/mavendd
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change
1
+ package dev .vaziak .mavendd ;
2
+
3
+ import lombok .Getter ;
4
+ import lombok .RequiredArgsConstructor ;
5
+
6
+ import java .util .List ;
7
+
8
+ @ Getter
9
+ @ RequiredArgsConstructor
10
+ public class DependencyResult {
11
+ private final ParsedPom parsedPom ;
12
+ private final List <ParsedPom .Dependency > unresolvedDependencies ;
13
+ }
Original file line number Diff line number Diff line change 8
8
import java .io .File ;
9
9
import java .io .IOException ;
10
10
import java .net .URL ;
11
+ import java .util .ArrayList ;
12
+ import java .util .List ;
11
13
12
14
@ Builder (builderMethodName = "of" )
13
15
@ AllArgsConstructor
@@ -20,13 +22,15 @@ public class MavenDownloader {
20
22
private boolean downloadJavaDocs ;
21
23
private boolean downloadSources ;
22
24
23
- public void download () {
25
+ public DependencyResult download () {
24
26
if (!exportDirectory .exists ()) {
25
27
if (!exportDirectory .mkdirs ()) {
26
28
throw new RuntimeException ("Failed to create export directory folder." );
27
29
}
28
30
}
29
31
32
+ List <ParsedPom .Dependency > unresolvedDependencies = new ArrayList <>();
33
+
30
34
getParsedPom ().getDependencies ().forEach (dependency -> {
31
35
File file = new File (exportDirectory , dependency .getOutputName ());
32
36
@@ -52,6 +56,7 @@ public void download() {
52
56
}).findFirst ().orElse (null );
53
57
54
58
if (repository == null ) {
59
+ unresolvedDependencies .add (dependency );
55
60
return ;
56
61
}
57
62
@@ -61,6 +66,8 @@ public void download() {
61
66
e .printStackTrace ();
62
67
}
63
68
});
69
+
70
+ return new DependencyResult (parsedPom , unresolvedDependencies );
64
71
}
65
72
66
73
public ParsedPom getParsedPom () {
You can’t perform that action at this time.
0 commit comments