public final class DefaultArtifact extends AbstractArtifact
Constructor and Description |
---|
DefaultArtifact(String coords)
Creates a new artifact with the specified coordinates.
|
DefaultArtifact(String coords,
Map<String,String> properties)
Creates a new artifact with the specified coordinates and properties.
|
DefaultArtifact(String groupId,
String artifactId,
String extension,
String version)
Creates a new artifact with the specified coordinates and no classifier.
|
DefaultArtifact(String groupId,
String artifactId,
String classifier,
String extension,
String version)
Creates a new artifact with the specified coordinates.
|
DefaultArtifact(String groupId,
String artifactId,
String classifier,
String extension,
String version,
ArtifactType type)
Creates a new artifact with the specified coordinates.
|
DefaultArtifact(String groupId,
String artifactId,
String classifier,
String extension,
String version,
Map<String,String> properties,
ArtifactType type)
Creates a new artifact with the specified coordinates and properties.
|
DefaultArtifact(String groupId,
String artifactId,
String classifier,
String extension,
String version,
Map<String,String> properties,
File file)
Creates a new artifact with the specified coordinates, properties and file.
|
Modifier and Type | Method and Description |
---|---|
String |
getArtifactId()
Gets the artifact identifier of this artifact, for example "maven-model".
|
String |
getClassifier()
Gets the classifier of this artifact, for example "sources".
|
String |
getExtension()
Gets the (file) extension of this artifact, for example "jar" or "tar.gz".
|
File |
getFile()
Gets the file of this artifact.
|
String |
getGroupId()
Gets the group identifier of this artifact, for example "org.apache.maven".
|
Map<String,String> |
getProperties()
Gets the properties of this artifact.
|
String |
getVersion()
Gets the version of this artifact, for example "1.0-20100529-1213".
|
copyProperties, equals, getBaseVersion, getProperty, hashCode, isSnapshot, setFile, setProperties, setVersion, toString
public DefaultArtifact(String coords)
jar
and classifier to an empty string.coords
- The artifact coordinates in the format
<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
, must not be null
.IllegalArgumentException
- If the artifact coordinates found in coords
do not match the expected
format.public DefaultArtifact(String coords, Map<String,String> properties)
jar
and classifier to an empty string.coords
- The artifact coordinates in the format
<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
, must not be null
.properties
- The artifact properties, may be null
.IllegalArgumentException
- If the artifact coordinates found in coords
do not match the expected
format.public DefaultArtifact(String groupId, String artifactId, String extension, String version)
null
for any of the
coordinates is equivalent to specifying an empty string.groupId
- The group identifier of the artifact, may be null
.artifactId
- The artifact identifier of the artifact, may be null
.extension
- The file extension of the artifact, may be null
.version
- The version of the artifact, may be null
.public DefaultArtifact(String groupId, String artifactId, String classifier, String extension, String version)
null
for any of the coordinates is
equivalent to specifying an empty string.groupId
- The group identifier of the artifact, may be null
.artifactId
- The artifact identifier of the artifact, may be null
.classifier
- The classifier of the artifact, may be null
.extension
- The file extension of the artifact, may be null
.version
- The version of the artifact, may be null
.public DefaultArtifact(String groupId, String artifactId, String classifier, String extension, String version, ArtifactType type)
null
for any of the coordinates is
equivalent to specifying an empty string. The optional artifact type provided to this constructor will be used to
determine the artifact's classifier and file extension if the corresponding arguments for this constructor are
null
.groupId
- The group identifier of the artifact, may be null
.artifactId
- The artifact identifier of the artifact, may be null
.classifier
- The classifier of the artifact, may be null
.extension
- The file extension of the artifact, may be null
.version
- The version of the artifact, may be null
.type
- The artifact type from which to query classifier, file extension and properties, may be null
.public DefaultArtifact(String groupId, String artifactId, String classifier, String extension, String version, Map<String,String> properties, ArtifactType type)
null
for any of the
coordinates is equivalent to specifying an empty string. The optional artifact type provided to this constructor
will be used to determine the artifact's classifier and file extension if the corresponding arguments for this
constructor are null
. If the artifact type specifies properties, those will get merged with the
properties passed directly into the constructor, with the latter properties taking precedence.groupId
- The group identifier of the artifact, may be null
.artifactId
- The artifact identifier of the artifact, may be null
.classifier
- The classifier of the artifact, may be null
.extension
- The file extension of the artifact, may be null
.version
- The version of the artifact, may be null
.properties
- The properties of the artifact, may be null
if none.type
- The artifact type from which to query classifier, file extension and properties, may be null
.public DefaultArtifact(String groupId, String artifactId, String classifier, String extension, String version, Map<String,String> properties, File file)
null
for any of the
coordinates is equivalent to specifying an empty string.groupId
- The group identifier of the artifact, may be null
.artifactId
- The artifact identifier of the artifact, may be null
.classifier
- The classifier of the artifact, may be null
.extension
- The file extension of the artifact, may be null
.version
- The version of the artifact, may be null
.properties
- The properties of the artifact, may be null
if none.file
- The resolved file of the artifact, may be null
.public String getGroupId()
Artifact
null
.public String getArtifactId()
Artifact
null
.public String getVersion()
Artifact
null
.public String getClassifier()
Artifact
null
.public String getExtension()
Artifact
null
.public File getFile()
Artifact
null
if the artifact isn't resolved.public Map<String,String> getProperties()
Artifact
null
.ArtifactProperties
Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.