Collection<String> excludes) throws RepositoryException { Artifact artifact = new DefaultArtifact(dependency); DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(JavaScopes.COMPILE); PatternExclusionsDependencyFilter exclusionFilter =
public Artifact setVersion( String version ) { return new DefaultArtifact( getGroupId(), getArtifactId(), getClassifier(), getExtension(), version, getFile(), getProperties() ); }
public String getBaseVersion() { if ( baseVersion == null ) { baseVersion = toBaseVersion( getVersion() ); } return baseVersion; }
public Artifact setFile( File file ) { if ( eq( getFile(), file ) ) { return this; } return newInstance( getGroupId(), getArtifactId(), getClassifier(), getExtension(), getVersion(), getProperties(), file ); }
public OverlayArtifactTypeRegistry add( ArtifactType type ) { super.add( type ); return this; }
public boolean isSnapshot() { return isSnapshot( getVersion() ); }
public Artifact setVersion( String version ) { Artifact artifact = delegate.setVersion( version ); if ( artifact != delegate ) { return newInstance( artifact ); } return this; }
DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version, File file, Map<String, String> properties ) { // NOTE: This constructor assumes immutability of the provided properties, for internal use only this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.classifier = emptify( classifier ); this.extension = emptify( extension ); this.version = emptify( version ); this.file = file; this.properties = properties; }
public ArtifactType get( String typeId ) { ArtifactType type = super.get( typeId ); if ( type == null && delegate != null ) { type = delegate.get( typeId ); } return type; }
private List<ArtifactResult> fetchArtifactWithDep(Dependency dep) throws DependencyResolutionException, ArtifactResolutionException { Artifact artifact = new DefaultArtifact(dep.getGroupArtifactVersion()); DependencyFilter classpathFilter = DependencyFilterUtils .classpathFilter(JavaScopes.COMPILE); PatternExclusionsDependencyFilter exclusionFilter = new PatternExclusionsDependencyFilter( dep.getExclusions()); CollectRequest collectRequest = new CollectRequest(); collectRequest.setRoot(new org.sonatype.aether.graph.Dependency(artifact, JavaScopes.COMPILE)); collectRequest.addRepository(mavenCentral); collectRequest.addRepository(mavenLocal); for (Repository repo : repositories) { RemoteRepository rr = new RemoteRepository(repo.getId(), "default", repo.getUrl()); rr.setPolicy(repo.isSnapshot(), null); collectRequest.addRepository(rr); } DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, DependencyFilterUtils.andFilter(exclusionFilter, classpathFilter)); return system.resolveDependencies(session, dependencyRequest).getArtifactResults(); }
public Artifact setProperties( Map<String, String> properties ) { if ( getProperties().equals( properties ) ) { return this; } return newInstance( getGroupId(), getArtifactId(), getClassifier(), getExtension(), getVersion(), copy( properties ), getFile() ); }
public Artifact setFile( File file ) { Artifact artifact = delegate.setFile( file ); if ( artifact != delegate ) { return newInstance( artifact ); } return this; }
@Override protected DefaultArtifact constructArtifact(final String groupId, final String artifactId, final String classifier, final String packaging, final String version) { return new DefaultArtifact(groupId, artifactId, classifier, packaging, version); } }
public Artifact setVersion( String version ) { if ( getVersion().equals( version ) ) { return this; } return newInstance( getGroupId(), getArtifactId(), getClassifier(), getExtension(), version, getProperties(), getFile() ); }
private static Artifact artifactFromCoords(String coords) { return new DefaultArtifact(coords); }
private Artifact toArtifact(GAV gav) { return new DefaultArtifact(gav.groupId, gav.artifactId, "jar", gav.version); }
/** * Creates a new artifact with the specified coordinates, properties and file. * * @param groupId The group identifier of the artifact, may be {@code null}. * @param artifactId The artifact identifier of the artifact, may be {@code null}. * @param classifier The classifier of the artifact, may be {@code null}. * @param extension The file extension of the artifact, may be {@code null}. * @param version The version of the artifact, may be {@code null}. * @param properties The properties of the artifact, may be {@code null} if none. The method may assume immutability * of the supplied map. * @param file The resolved file of the artifact, may be {@code null}. */ protected Artifact newInstance( String groupId, String artifactId, String classifier, String extension, String version, Map<String, String> properties, File file ) { return new DefaultArtifact( groupId, artifactId, classifier, extension, version, file, properties ); }
public Artifact setVersion( String version ) { if ( this.version.equals( version ) || ( version == null && this.version.length() <= 0 ) ) { return this; } return new DefaultArtifact( groupId, artifactId, classifier, extension, version, file, properties ); }
private static Artifact createArtifact(final ArtifactId artifactId) { final DefaultArtifact artifact = new DefaultArtifact(artifactId.getGroupId(), artifactId.getName(), artifactId.getClassifier(), artifactId.getArchiveType(), artifactId.getVersion()); return artifact; }
static Artifact coordinateToMavenArtifact(final Coordinate dep) { Artifact artifact = new DefaultArtifact(dep.getGroupId(), dep.getArtifactId(), dep.getClassifier(), dep.getPackaging() == null ? "jar" : dep.getPackaging(), dep.getVersion()); return artifact; }