use of org.eclipse.aether.util.graph.visitor.PathRecordingDependencyVisitor in project mule by mulesoft.
the class DependencyResolver method logDependencyGraph.
private void logDependencyGraph(DependencyNode node, Object request) {
if (logger.isTraceEnabled()) {
PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor(null, false);
node.accept(visitor);
logger.trace("******* Dependency Graph calculated for {} with request: '{}' *******", request.getClass().getSimpleName(), request);
visitor.getPaths().stream().forEach(pathList -> logger.trace(on(" -> ").join(pathList.stream().filter(path -> path != null).collect(toList()))));
logger.trace("******* End of dependency Graph *******");
}
}
use of org.eclipse.aether.util.graph.visitor.PathRecordingDependencyVisitor 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