@Override protected ArtifactRef cloneTarget( final ArtifactRef target ) { return new SimpleArtifactRef( target ); }
@Override protected ArtifactRef cloneTarget( final ArtifactRef target ) { return new SimpleArtifactRef( target ); }
@Override public T detach() { return (T) new SimpleArtifactRef( this ); } }
@Override public ArtifactRef asArtifactRef( final String type, final String classifier ) { return new SimpleArtifactRef( this, type, classifier ); }
@Override public ArtifactRef asArtifactRef( final TypeAndClassifier tc ) { return new SimpleArtifactRef( this, tc ); }
public static ArtifactRef artifact( final ProjectVersionRef dep, final String type, final String classifier ) { return new SimpleArtifactRef( dep, type, classifier ); }
public static ArtifactRef artifact( final String groupId, final String artifactId, final String version, final String type, final String classifier ) throws InvalidVersionSpecificationException { return new SimpleArtifactRef( projectVersion( groupId, artifactId, version ), type, classifier ); }
public static ArtifactRef artifact( final String groupId, final String artifactId, final String version ) throws InvalidVersionSpecificationException { return new SimpleArtifactRef( projectVersion( groupId, artifactId, version ), null, null ); }
@Override public ArtifactRef getTargetArtifact() { return new SimpleArtifactRef( getTarget(), null, null ); }
@Override public ArtifactRef getTargetArtifact() { return new SimpleArtifactRef( getTarget(), "maven-plugin", null ); }
@Override public ArtifactRef getTargetArtifact() { return new SimpleArtifactRef( getTarget(), "maven-plugin", null ); }
@Override public ArtifactRef getTargetArtifact() { return new SimpleArtifactRef( getTarget(), "pom", null ); }
public Builder withDependency( final ProjectVersionRef ref, final String type, final String classifier, final DependencyScope scope, final boolean managed, final boolean inherited, final boolean optional ) { withDependencies( new SimpleDependencyRelationship( source, ref, new SimpleArtifactRef( ref, type, classifier ), scope, getNextDependencyIndex( managed ), managed, inherited, optional ) ); return this; }
public static SimpleArtifactRef parse( final String spec ) { final String[] parts = spec.split( ":" ); if ( parts.length < 3 || isEmpty( parts[0] ) || isEmpty( parts[1] ) || isEmpty( parts[2] ) ) { throw new InvalidRefException( "SimpleArtifactRef must contain AT LEAST non-empty groupId, artifactId, AND version. (Given: '" + spec + "')" ); } final String g = parts[0]; final String a = parts[1]; // assume we're actually parsing a GAV into a POM artifact... String v = parts[2]; String t = "pom"; String c = null; if ( parts.length > 3 ) { // oops, it's a type, not a version...see toString() for the specification. t = v; v = parts[3]; if ( parts.length > 4 ) { c = parts[4]; } } // assume non-optional, because it might not matter if you're parsing a string like this...you'd be more careful if you were reading something // that had an optional field, because it's not in the normal GATV[C] spec. return new SimpleArtifactRef( g, a, v, t, c ); }
@Override public SimpleArtifactRef newRef( final String groupId, final String artifactId, final SingleVersion version ) { return new SimpleArtifactRef( groupId, artifactId, version, tc.getType(), tc.getClassifier() ); }
SimpleArtifactRef sar = new SimpleArtifactRef( g, a, v, d.getType(), d.getClassifier() );
@Override public boolean versionlessEquals( final ProjectVersionRef other ) { if ( !super.versionlessEquals( other ) ) { return false; } if ( !( other instanceof ArtifactRef ) ) { // compare vs. POM reference. return artifactFieldsEqual( new SimpleArtifactRef( other, "pom", null ) ); } return artifactFieldsEqual( (ArtifactRef) other ); }
public ArtifactRef getArtifact() { return new SimpleArtifactRef( getGroupId(), getArtifactId(), getVersion(), getType(), getClassifier() ); }
@Override public DependencyRelationship selectTarget( final ProjectVersionRef ref ) { final ProjectVersionRef d = getDeclaring(); ArtifactRef t = getTarget(); t = (ArtifactRef) ( ( ref instanceof ArtifactRef ) ? ref : new SimpleArtifactRef( ref, t.getType(), t.getClassifier() ) ); Set<ProjectRef> var = getExcludes(); return new SimpleDependencyRelationship( getSources(), getPomLocation(), d, t, getScope(), getIndex(), isManaged(), isInherited(), optional, var.toArray( new ProjectRef[var.size()] ) ); }
@Override public PluginDependencyRelationship selectTarget( final ProjectVersionRef ref ) { final ProjectVersionRef d = getDeclaring(); ArtifactRef t = getTarget(); t = (ArtifactRef) ( ( ref instanceof ArtifactRef ) ? ref : new SimpleArtifactRef( ref, t.getType(), t.getClassifier() ) ); return new SimplePluginDependencyRelationship( getSources(), getPomLocation(), d, getPlugin(), t, getIndex(), isManaged(), isInherited() ); }