Search in sources :

Example 1 with PathRecordingDependencyVisitor

use of org.sonatype.aether.util.graph.PathRecordingDependencyVisitor in project sonatype-aether by sonatype.

the class NearestVersionConflictResolver method newFailure.

private UnsolvableVersionConflictException newFailure(final ConflictGroup group, final Map<?, ?> conflictIds, DependencyNode root) {
    DependencyFilter filter = new DependencyFilter() {

        public boolean accept(DependencyNode node, List<DependencyNode> parents) {
            return group.key.equals(conflictIds.get(node));
        }
    };
    PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor(filter);
    root.accept(visitor);
    return new UnsolvableVersionConflictException(visitor.getPaths(), group.key);
}
Also used : PathRecordingDependencyVisitor(org.sonatype.aether.util.graph.PathRecordingDependencyVisitor) DependencyNode(org.sonatype.aether.graph.DependencyNode) DependencyFilter(org.sonatype.aether.graph.DependencyFilter) List(java.util.List) UnsolvableVersionConflictException(org.sonatype.aether.collection.UnsolvableVersionConflictException)

Aggregations

List (java.util.List)1 UnsolvableVersionConflictException (org.sonatype.aether.collection.UnsolvableVersionConflictException)1 DependencyFilter (org.sonatype.aether.graph.DependencyFilter)1 DependencyNode (org.sonatype.aether.graph.DependencyNode)1 PathRecordingDependencyVisitor (org.sonatype.aether.util.graph.PathRecordingDependencyVisitor)1