Package org.eclipse.aether.artifact
Class DefaultArtifact
java.lang.Object
org.eclipse.aether.artifact.AbstractArtifact
org.eclipse.aether.artifact.DefaultArtifact
- All Implemented Interfaces:
- Artifact
A simple artifact. Note: Instances of this class are immutable and the exposed mutators return new objects
 rather than changing the current instance.
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultArtifact(String coords) Creates a new artifact with the specified coordinates.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, Map<String, String> properties, File file) Creates a new artifact with the specified coordinates, properties and file.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, ArtifactType type) 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.
- 
Method SummaryModifier and TypeMethodDescriptionGets the artifact identifier of this artifact, for example "maven-model".Gets the classifier of this artifact, for example "sources".Gets the (file) extension of this artifact, for example "jar" or "tar.gz".getFile()Gets the file of this artifact.Gets the group identifier of this artifact, for example "org.apache.maven".Gets the properties of this artifact.Gets the version of this artifact, for example "1.0-20100529-1213".Methods inherited from class org.eclipse.aether.artifact.AbstractArtifactcopyProperties, equals, getBaseVersion, getProperty, hashCode, isSnapshot, setFile, setProperties, setVersion, toString
- 
Constructor Details- 
DefaultArtifactCreates a new artifact with the specified coordinates. If not specified in the artifact coordinates, the artifact's extension defaults tojarand classifier to an empty string.- Parameters:
- coords- The artifact coordinates in the format- <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>, must not be- null.
- Throws:
- IllegalArgumentException- If the artifact coordinates found in- coordsdo not match the expected format.
 
- 
DefaultArtifactCreates a new artifact with the specified coordinates and properties. If not specified in the artifact coordinates, the artifact's extension defaults tojarand classifier to an empty string.- Parameters:
- coords- The artifact coordinates in the format- <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>, must not be- null.
- properties- The artifact properties, may be- null.
- Throws:
- IllegalArgumentException- If the artifact coordinates found in- coordsdo not match the expected format.
 
- 
DefaultArtifactCreates a new artifact with the specified coordinates and no classifier. Passingnullfor any of the coordinates is equivalent to specifying an empty string.- Parameters:
- 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.
 
- 
DefaultArtifactpublic DefaultArtifact(String groupId, String artifactId, String classifier, String extension, String version) Creates a new artifact with the specified coordinates. Passingnullfor any of the coordinates is equivalent to specifying an empty string.- Parameters:
- 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.
 
- 
DefaultArtifactpublic DefaultArtifact(String groupId, String artifactId, String classifier, String extension, String version, ArtifactType type) Creates a new artifact with the specified coordinates. Passingnullfor 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 arenull.- Parameters:
- 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.
 
- 
DefaultArtifactpublic 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. Passingnullfor 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 arenull. If the artifact type specifies properties, those will get merged with the properties passed directly into the constructor, with the latter properties taking precedence.- Parameters:
- 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- nullif none.
- type- The artifact type from which to query classifier, file extension and properties, may be- null.
 
- 
DefaultArtifactpublic 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. Passingnullfor any of the coordinates is equivalent to specifying an empty string.- Parameters:
- 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- nullif none.
- file- The resolved file of the artifact, may be- null.
 
 
- 
- 
Method Details- 
getGroupIdDescription copied from interface:ArtifactGets the group identifier of this artifact, for example "org.apache.maven".- Returns:
- The group identifier, never null.
 
- 
getArtifactIdDescription copied from interface:ArtifactGets the artifact identifier of this artifact, for example "maven-model".- Returns:
- The artifact identifier, never null.
 
- 
getVersionDescription copied from interface:ArtifactGets the version of this artifact, for example "1.0-20100529-1213". Note that in case of meta versions like "1.0-SNAPSHOT", the artifact's version depends on the state of the artifact. Artifacts that have been resolved or deployed will usually have the meta version expanded.- Returns:
- The version, never null.
 
- 
getClassifierDescription copied from interface:ArtifactGets the classifier of this artifact, for example "sources".- Returns:
- The classifier or an empty string if none, never null.
 
- 
getExtensionDescription copied from interface:ArtifactGets the (file) extension of this artifact, for example "jar" or "tar.gz".- Returns:
- The file extension (without leading period), never null.
 
- 
getFileDescription copied from interface:ArtifactGets the file of this artifact. Note that only resolved artifacts have a file associated with them. In general, callers must not assume any relationship between an artifact's filename and its coordinates.- Returns:
- The file or nullif the artifact isn't resolved.
 
- 
getPropertiesDescription copied from interface:ArtifactGets the properties of this artifact. Clients may use these properties to associate non-persistent values with an artifact that help later processing when the artifact gets passed around within the application.- Returns:
- The (read-only) properties, never null.
- See Also:
 
 
-