public DependencyGraph( String groupId, String artifactId, String version ) { ArtifactReference rootRef = new ArtifactReference(); rootRef.setGroupId( groupId ); rootRef.setArtifactId( artifactId ); rootRef.setVersion( version ); rootRef.setClassifier( "" ); rootRef.setType( "pom" ); this.rootNode = new DependencyGraphNode( rootRef ); }
artifact.setGroupId( pathParts[0] );
private void addDependencies( List<Dependency> dependencies ) { for ( Dependency dep : dependencies ) { String key = DependencyGraphKeys.toManagementKey( dep ); Rules merged = (Rules) depMap.get( key ); if ( merged == null ) { // New map entry. merged = new Rules(); merged.artifact = new ArtifactReference(); merged.artifact.setGroupId( dep.getGroupId() ); merged.artifact.setArtifactId( dep.getArtifactId() ); merged.artifact.setClassifier( dep.getClassifier() ); merged.artifact.setType( dep.getType() ); } merged.artifact.setVersion( dep.getVersion() ); if ( StringUtils.isNotBlank( dep.getScope() ) ) { merged.scope = dep.getScope(); } merged.addAllExclusions( dep.getExclusions() ); depMap.put( key, merged ); } }
public static ArtifactReference clone( ArtifactReference artifactReference ) { if ( artifactReference == null ) { return null; } ArtifactReference cloned = new ArtifactReference(); cloned.setGroupId( artifactReference.getGroupId() ); cloned.setArtifactId( artifactReference.getArtifactId() ); cloned.setVersion( artifactReference.getVersion() ); cloned.setClassifier( artifactReference.getClassifier() ); cloned.setType( artifactReference.getType() ); return cloned; }
private void doPurgeAllRelated( ArtifactReference reference, String version ) throws LayoutException { ArtifactReference artifact = new ArtifactReference(); artifact.setGroupId( reference.getGroupId() ); artifact.setArtifactId( reference.getArtifactId() ); artifact.setVersion( version ); artifact.setClassifier( reference.getClassifier() ); artifact.setType( reference.getType() ); try { Set<ArtifactReference> related = repository.getRelatedArtifacts( artifact ); purge( related, repository ); } catch ( ContentNotFoundException e ) { // Nothing to do here. // TODO: Log this? } } }
refTO.setGroupId( fromNode.getArtifact().getGroupId() ); refTO.setArtifactId( fromNode.getArtifact().getArtifactId() ); refTO.setVersion( fromNode.getArtifact().getVersion() ); refTO.setGroupId( relocation.getGroupId() ); artifactRef.setGroupId( dependency.getGroupId() ); artifactRef.setArtifactId( dependency.getArtifactId() ); artifactRef.setVersion( dependency.getVersion() );
toRef.setGroupId( fromRef.getGroupId() ); toRef.setArtifactId( fromRef.getArtifactId() ); toRef.setVersion( toVersion );