public DependencyNode build() { Dependency dependency = null; if ( artifactId != null && artifactId.length() > 0 ) { Artifact artifact = new DefaultArtifact( groupId, artifactId, classifier, ext, version, properties, (File) null ); dependency = new Dependency( artifact, scope, optional ); } DefaultDependencyNode node = new DefaultDependencyNode( dependency ); if ( artifactId != null && artifactId.length() > 0 ) { try { node.setVersion( versionScheme.parseVersion( version ) ); node.setVersionConstraint( versionScheme.parseVersionConstraint( range != null ? range : version ) ); } catch ( InvalidVersionSpecificationException e ) { throw new IllegalArgumentException( "bad version: " + e.getMessage(), e ); } } node.setRequestContext( context ); node.setRelocations( relocations ); return node; }
private static DefaultDependencyNode createDependencyNode( List<Artifact> relocations, PremanagedDependency preManaged, VersionRangeResult rangeResult, Version version, Dependency d, Collection<Artifact> aliases, List<RemoteRepository> repos, String requestContext ) { DefaultDependencyNode child = new DefaultDependencyNode( d ); preManaged.applyTo( child ); child.setRelocations( relocations ); child.setVersionConstraint( rangeResult.getVersionConstraint() ); child.setVersion( version ); child.setAliases( aliases ); child.setRepositories( repos ); child.setRequestContext( requestContext ); return child; }
private static DefaultDependencyNode createDependencyNode( List<Artifact> relocations, PremanagedDependency preManaged, VersionRangeResult rangeResult, Version version, Dependency d, Collection<Artifact> aliases, List<RemoteRepository> repos, String requestContext ) { DefaultDependencyNode child = new DefaultDependencyNode( d ); preManaged.applyTo( child ); child.setRelocations( relocations ); child.setVersionConstraint( rangeResult.getVersionConstraint() ); child.setVersion( version ); child.setAliases( aliases ); child.setRepositories( repos ); child.setRequestContext( requestContext ); return child; }
/** * Creates a mostly shallow clone of the specified node. The new node has its own copy of any custom data and * initially no children. * * @param node The node to copy, must not be {@code null}. */ public DefaultDependencyNode( DependencyNode node ) { dependency = node.getDependency(); artifact = node.getArtifact(); children = new ArrayList<DependencyNode>( 0 ); setAliases( node.getAliases() ); setRequestContext( node.getRequestContext() ); setManagedBits( node.getManagedBits() ); setRelocations( node.getRelocations() ); setRepositories( node.getRepositories() ); setVersion( node.getVersion() ); setVersionConstraint( node.getVersionConstraint() ); Map<?, ?> data = node.getData(); setData( data.isEmpty() ? null : new HashMap<Object, Object>( data ) ); }
/** * Creates a mostly shallow clone of the specified node. The new node has its own copy of any custom data and * initially no children. * * @param node The node to copy, must not be {@code null}. */ public DefaultDependencyNode( DependencyNode node ) { dependency = node.getDependency(); artifact = node.getArtifact(); children = new ArrayList<DependencyNode>( 0 ); setAliases( node.getAliases() ); setRequestContext( node.getRequestContext() ); setManagedBits( node.getManagedBits() ); setRelocations( node.getRelocations() ); setRepositories( node.getRepositories() ); setVersion( node.getVersion() ); setVersionConstraint( node.getVersionConstraint() ); Map<?, ?> data = node.getData(); setData( data.isEmpty() ? null : new HashMap<Object, Object>( data ) ); }
node.setVersion( versionScheme.parseVersion( artifact.getVersion() ) ); node.setVersionConstraint( versionScheme.parseVersionConstraint( def.range != null ? def.range : artifact.getVersion() ) );
rootNode.setVersion(versionScheme.parseVersion(pomVersion)); rootNode.setVersionConstraint(versionScheme.parseVersionConstraint(pomVersion)); DependencyNode pomNode = rootNode;
node.setRelocations( descriptorResult.getRelocations() ); node.setVersionConstraint( rangeResult.getVersionConstraint() ); node.setVersion( version ); node.setAliases( descriptorResult.getAliases() ); node.setRepositories( request.getRepositories() );
node.setRelocations( descriptorResult.getRelocations() ); node.setVersionConstraint( rangeResult.getVersionConstraint() ); node.setVersion( version ); node.setAliases( descriptorResult.getAliases() ); node.setRepositories( request.getRepositories() );