use of org.eclipse.aether.util.filter.PatternInclusionsDependencyFilter in project mule by mulesoft.
the class DependencyResolver method logUnresolvedArtifacts.
/**
* Logs the paths for each dependency not found
*
* @param node root {@link DependencyNode}, can be a "null" root (imaginary root)
* @param e {@link DependencyResolutionException} the error to collect paths.
*/
private void logUnresolvedArtifacts(DependencyNode node, DependencyResolutionException e) {
List<ArtifactResult> artifactResults = e.getResult().getArtifactResults().stream().filter(artifactResult -> !artifactResult.getExceptions().isEmpty()).collect(toList());
final List<String> patternInclusion = artifactResults.stream().map(artifactResult -> toId(artifactResult.getRequest().getArtifact())).collect(toList());
PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor(new PatternInclusionsDependencyFilter(patternInclusion), node.getArtifact() != null);
node.accept(visitor);
visitor.getPaths().stream().forEach(path -> {
List<DependencyNode> unresolvedArtifactPath = path.stream().filter(dependencyNode -> dependencyNode.getArtifact() != null).collect(toList());
if (!unresolvedArtifactPath.isEmpty()) {
logger.warn("Dependency path to not resolved artifacts -> {}", unresolvedArtifactPath.toString());
}
});
}
Aggregations