|
34 | 34 | import java.nio.file.Path; |
35 | 35 | import java.util.ArrayList; |
36 | 36 | import java.util.Collection; |
37 | | -import java.util.Collections; |
38 | 37 | import java.util.HashMap; |
39 | 38 | import java.util.List; |
40 | 39 | import java.util.Map; |
|
121 | 120 | import org.eclipse.aether.RepositorySystemSession; |
122 | 121 | import org.eclipse.aether.graph.DependencyFilter; |
123 | 122 | import org.eclipse.aether.repository.RemoteRepository; |
124 | | -import org.eclipse.aether.resolution.ArtifactResult; |
125 | 123 | import org.eclipse.aether.resolution.DependencyResult; |
126 | 124 | import org.eclipse.aether.util.filter.AndDependencyFilter; |
127 | 125 | import org.slf4j.Logger; |
@@ -463,12 +461,10 @@ private List<org.eclipse.aether.artifact.Artifact> toAetherArtifacts(final List< |
463 | 461 | } |
464 | 462 |
|
465 | 463 | private List<Artifact> toMavenArtifacts(DependencyResult dependencyResult) { |
466 | | - List<Artifact> artifacts = |
467 | | - new ArrayList<>(dependencyResult.getArtifactResults().size()); |
468 | | - dependencyResult.getArtifactResults().stream() |
469 | | - .filter(ArtifactResult::isResolved) |
470 | | - .forEach(a -> artifacts.add(RepositoryUtils.toArtifact(a.getArtifact()))); |
471 | | - return Collections.unmodifiableList(artifacts); |
| 464 | + return dependencyResult.getDependencyNodeResults().stream() |
| 465 | + .filter(n -> n.getArtifact().getPath() != null) |
| 466 | + .map(n -> RepositoryUtils.toArtifact(n.getDependency())) |
| 467 | + .collect(Collectors.toUnmodifiableList()); |
472 | 468 | } |
473 | 469 |
|
474 | 470 | private Map<String, ClassLoader> calcImports( |
|
0 commit comments