public UnsolvableVersionConflictException( Collection<List<DependencyNode>> paths, Object dependencyConflictId ) { super( "Could not resolve version conflict among " + toPaths( paths ) ); this.dependencyConflictId = ( dependencyConflictId != null ) ? dependencyConflictId : ""; if ( paths == null ) { this.paths = Collections.emptyList(); this.versions = Collections.emptyList(); } else { this.paths = paths; this.versions = new LinkedHashSet<String>(); for ( List<DependencyNode> path : paths ) { VersionConstraint constraint = path.get( path.size() - 1 ).getVersionConstraint(); if ( constraint != null && !constraint.getRanges().isEmpty() ) { versions.add( constraint.toString() ); } } } }
public UnsolvableVersionConflictException( Collection<List<DependencyNode>> paths, Object dependencyConflictId ) { super( "Could not resolve version conflict among " + toPaths( paths ) ); this.dependencyConflictId = ( dependencyConflictId != null ) ? dependencyConflictId : ""; if ( paths == null ) { this.paths = Collections.emptyList(); this.versions = Collections.emptyList(); } else { this.paths = paths; this.versions = new LinkedHashSet<String>(); for ( List<DependencyNode> path : paths ) { VersionConstraint constraint = path.get( path.size() - 1 ).getVersionConstraint(); if ( constraint != null && !constraint.getRanges().isEmpty() ) { versions.add( constraint.toString() ); } } } }
public UnsolvableVersionConflictException( Collection<List<DependencyNode>> paths, Object dependencyConflictId ) { super( "Could not resolve version conflict among " + toPaths( paths ) ); this.dependencyConflictId = ( dependencyConflictId != null ) ? dependencyConflictId : ""; if ( paths == null ) { this.paths = Collections.emptyList(); this.versions = Collections.emptyList(); } else { this.paths = paths; this.versions = new LinkedHashSet<String>(); for ( List<DependencyNode> path : paths ) { VersionConstraint constraint = path.get( path.size() - 1 ).getVersionConstraint(); if ( constraint != null && !constraint.getRanges().isEmpty() ) { versions.add( constraint.toString() ); } } } }
private static String toPath( List<DependencyNode> path ) { StringBuilder buffer = new StringBuilder( 256 ); for ( Iterator<DependencyNode> it = path.iterator(); it.hasNext(); ) { DependencyNode node = it.next(); if ( node.getDependency() == null ) { continue; } Artifact artifact = node.getDependency().getArtifact(); buffer.append( artifact.getGroupId() ); buffer.append( ':' ).append( artifact.getArtifactId() ); buffer.append( ':' ).append( artifact.getExtension() ); if ( artifact.getClassifier().length() > 0 ) { buffer.append( ':' ).append( artifact.getClassifier() ); } buffer.append( ':' ).append( node.getVersionConstraint() ); if ( it.hasNext() ) { buffer.append( " -> " ); } } return buffer.toString(); }
private static String toPath( List<DependencyNode> path ) { StringBuilder buffer = new StringBuilder( 256 ); for ( Iterator<DependencyNode> it = path.iterator(); it.hasNext(); ) { DependencyNode node = it.next(); if ( node.getDependency() == null ) { continue; } Artifact artifact = node.getDependency().getArtifact(); buffer.append( artifact.getGroupId() ); buffer.append( ':' ).append( artifact.getArtifactId() ); buffer.append( ':' ).append( artifact.getExtension() ); if ( artifact.getClassifier().length() > 0 ) { buffer.append( ':' ).append( artifact.getClassifier() ); } buffer.append( ':' ).append( node.getVersionConstraint() ); if ( it.hasNext() ) { buffer.append( " -> " ); } } return buffer.toString(); }
private static String toPath( List<DependencyNode> path ) { StringBuilder buffer = new StringBuilder( 256 ); for ( Iterator<DependencyNode> it = path.iterator(); it.hasNext(); ) { DependencyNode node = it.next(); if ( node.getDependency() == null ) { continue; } Artifact artifact = node.getDependency().getArtifact(); buffer.append( artifact.getGroupId() ); buffer.append( ':' ).append( artifact.getArtifactId() ); buffer.append( ':' ).append( artifact.getExtension() ); if ( artifact.getClassifier().length() > 0 ) { buffer.append( ':' ).append( artifact.getClassifier() ); } buffer.append( ':' ).append( node.getVersionConstraint() ); if ( it.hasNext() ) { buffer.append( " -> " ); } } return buffer.toString(); }
if (!node.getVersionConstraint().getRanges().isEmpty()) { group.constraints.add(node.getVersionConstraint());
VersionConstraint versionConstraint = node.getVersionConstraint(); if (versionConstraint != null && versionConstraint.getRanges() != null && !versionConstraint.getRanges().isEmpty()) { group.constraints.add(versionConstraint);
private DependencyNode buildDependencyNode( DependencyNode parent, org.sonatype.aether.graph.DependencyNode node, Artifact artifact, ArtifactFilter filter ) { DefaultDependencyNode current = new DefaultDependencyNode( parent, artifact, null /* node.getPremanagedVersion() */, null /* node.getPremanagedScope() */, getVersionSelectedFromRange( node.getVersionConstraint() ) ); List<DependencyNode> nodes = new ArrayList<DependencyNode>( node.getChildren().size() ); for ( org.sonatype.aether.graph.DependencyNode child : node.getChildren() ) { Artifact childArtifact = getDependencyArtifact( child.getDependency() ); if ( ( filter == null ) || filter.include( childArtifact ) ) { nodes.add( buildDependencyNode( current, child, childArtifact, filter ) ); } } current.setChildren( Collections.unmodifiableList( nodes ) ); return current; }
VersionConstraint versionConstraint = node.getVersionConstraint(); if (versionConstraint != null && versionConstraint.getRanges() != null && !versionConstraint.getRanges().isEmpty()) { group.constraints.add(versionConstraint);
private DependencyNode buildDependencyNode( DependencyNode parent, org.sonatype.aether.graph.DependencyNode node, Artifact artifact, ArtifactFilter filter ) { DefaultDependencyNode current = new DefaultDependencyNode( parent, artifact, null /* node.getPremanagedVersion() */, null /* node.getPremanagedScope() */, getVersionSelectedFromRange( node.getVersionConstraint() ) ); List<DependencyNode> nodes = new ArrayList<DependencyNode>( node.getChildren().size() ); for ( org.sonatype.aether.graph.DependencyNode child : node.getChildren() ) { Artifact childArtifact = getDependencyArtifact( child.getDependency() ); if ( ( filter == null ) || filter.include( childArtifact ) ) { nodes.add( buildDependencyNode( current, child, childArtifact, filter ) ); } } current.setChildren( Collections.unmodifiableList( nodes ) ); return current; }
VersionConstraint constraint = node.getVersionConstraint();
/** * Creates a shallow clone of the specified node. * * @param node The node to copy, must not be {@code null}. */ public TestDependencyNode( DependencyNode node ) { setDependency( node.getDependency() ); setAliases( node.getAliases() ); setRequestContext( node.getRequestContext() ); setPremanagedScope( node.getPremanagedScope() ); setPremanagedVersion( node.getPremanagedVersion() ); setRelocations( node.getRelocations() ); setRepositories( node.getRepositories() ); setVersion( node.getVersion() ); setVersionConstraint( node.getVersionConstraint() ); }
/** * Creates a shallow clone of the specified node. * * @param node The node to copy, must not be {@code null}. */ public TestDependencyNode( DependencyNode node ) { setDependency( node.getDependency() ); setAliases( node.getAliases() ); setRequestContext( node.getRequestContext() ); setPremanagedScope( node.getPremanagedScope() ); setPremanagedVersion( node.getPremanagedVersion() ); setRelocations( node.getRelocations() ); setRepositories( node.getRepositories() ); setVersion( node.getVersion() ); setVersionConstraint( node.getVersionConstraint() ); }
/** * Creates a shallow clone of the specified node. * * @param node The node to copy, must not be {@code null}. */ public DefaultDependencyNode( DependencyNode node ) { setDependency( node.getDependency() ); setAliases( node.getAliases() ); setRequestContext( node.getRequestContext() ); setPremanagedScope( node.getPremanagedScope() ); setPremanagedVersion( node.getPremanagedVersion() ); setRelocations( node.getRelocations() ); setRepositories( node.getRepositories() ); setVersion( node.getVersion() ); setVersionConstraint( node.getVersionConstraint() ); setData( node.getData() ); }