public final class SubArtifact extends AbstractArtifact
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
classifier |
private java.lang.String |
extension |
private java.io.File |
file |
private Artifact |
mainArtifact |
private java.util.Map<java.lang.String,java.lang.String> |
properties |
| Modifier | Constructor and Description |
|---|---|
|
SubArtifact(Artifact mainArtifact,
java.lang.String classifier,
java.lang.String extension)
Creates a new sub artifact.
|
|
SubArtifact(Artifact mainArtifact,
java.lang.String classifier,
java.lang.String extension,
java.io.File file)
Creates a new sub artifact.
|
private |
SubArtifact(Artifact mainArtifact,
java.lang.String classifier,
java.lang.String extension,
java.io.File file,
java.util.Map<java.lang.String,java.lang.String> properties) |
|
SubArtifact(Artifact mainArtifact,
java.lang.String classifier,
java.lang.String extension,
java.util.Map<java.lang.String,java.lang.String> properties)
Creates a new sub artifact.
|
|
SubArtifact(Artifact mainArtifact,
java.lang.String classifier,
java.lang.String extension,
java.util.Map<java.lang.String,java.lang.String> properties,
java.io.File file)
Creates a new sub artifact.
|
| Modifier and Type | Method and Description |
|---|---|
private static java.lang.String |
expand(java.lang.String pattern,
java.lang.String replacement) |
java.lang.String |
getArtifactId()
Gets the artifact identifier of this artifact, for example "maven-model".
|
java.lang.String |
getBaseVersion()
Gets the base version of this artifact, for example "1.0-SNAPSHOT".
|
java.lang.String |
getClassifier()
Gets the classifier of this artifact, for example "sources".
|
java.lang.String |
getExtension()
Gets the (file) extension of this artifact, for example "jar" or "tar.gz".
|
java.io.File |
getFile()
Gets the file of this artifact.
|
java.lang.String |
getGroupId()
Gets the group identifier of this artifact, for example "org.apache.maven".
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Gets the properties of this artifact.
|
java.lang.String |
getVersion()
Gets the version of this artifact, for example "1.0-20100529-1213".
|
boolean |
isSnapshot()
Determines whether this artifact uses a snapshot version.
|
Artifact |
setFile(java.io.File file)
Sets the file of the artifact.
|
Artifact |
setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Sets the properties for the artifact.
|
copyProperties, equals, getProperty, hashCode, setVersion, toStringprivate final Artifact mainArtifact
private final java.lang.String classifier
private final java.lang.String extension
private final java.io.File file
private final java.util.Map<java.lang.String,java.lang.String> properties
public SubArtifact(Artifact mainArtifact, java.lang.String classifier, java.lang.String extension)
mainArtifact - The artifact from which to derive the identity, must not be null.classifier - The classifier for this artifact, may be null if none.extension - The extension for this artifact, may be null if none.public SubArtifact(Artifact mainArtifact, java.lang.String classifier, java.lang.String extension, java.io.File file)
mainArtifact - The artifact from which to derive the identity, must not be null.classifier - The classifier for this artifact, may be null if none.extension - The extension for this artifact, may be null if none.file - The file for this artifact, may be null if unresolved.public SubArtifact(Artifact mainArtifact, java.lang.String classifier, java.lang.String extension, java.util.Map<java.lang.String,java.lang.String> properties)
mainArtifact - The artifact from which to derive the identity, must not be null.classifier - The classifier for this artifact, may be null if none.extension - The extension for this artifact, may be null if none.properties - The properties of the artifact, may be null.public SubArtifact(Artifact mainArtifact, java.lang.String classifier, java.lang.String extension, java.util.Map<java.lang.String,java.lang.String> properties, java.io.File file)
mainArtifact - The artifact from which to derive the identity, must not be null.classifier - The classifier for this artifact, may be null if none.extension - The extension for this artifact, may be null if none.properties - The properties of the artifact, may be null.file - The file for this artifact, may be null if unresolved.private SubArtifact(Artifact mainArtifact, java.lang.String classifier, java.lang.String extension, java.io.File file, java.util.Map<java.lang.String,java.lang.String> properties)
public java.lang.String getGroupId()
Artifactnull.public java.lang.String getArtifactId()
Artifactnull.public java.lang.String getVersion()
Artifactnull.public java.lang.String getBaseVersion()
ArtifactArtifact.getVersion(), the
base version will always refer to the unresolved meta version.getBaseVersion in interface ArtifactgetBaseVersion in class AbstractArtifactnull.public boolean isSnapshot()
ArtifactisSnapshot in interface ArtifactisSnapshot in class AbstractArtifacttrue if the artifact is a snapshot, false otherwise.public java.lang.String getClassifier()
Artifactnull.public java.lang.String getExtension()
Artifactnull.public java.io.File getFile()
Artifactnull if the artifact isn't resolved.public Artifact setFile(java.io.File file)
ArtifactsetFile in interface ArtifactsetFile in class AbstractArtifactfile - The file of the artifact, may be nullnull.public java.util.Map<java.lang.String,java.lang.String> getProperties()
Artifactnull.ArtifactPropertiespublic Artifact setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
ArtifactsetProperties in interface ArtifactsetProperties in class AbstractArtifactproperties - The properties for the artifact, may be null.null.ArtifactPropertiesprivate static java.lang.String expand(java.lang.String pattern,
java.lang.String replacement)