Package org.eclipse.aether.artifact
Interface Artifact
- All Known Implementing Classes:
- AbstractArtifact,- DefaultArtifact
public interface Artifact
A specific artifact. In a nutshell, an artifact has identifying coordinates and optionally a file that denotes its
 data. Note: Artifact instances are supposed to be immutable, e.g. any exposed mutator method returns a new
 artifact instance and leaves the original instance unchanged. Note: Implementors are strongly advised to
 inherit from 
AbstractArtifact instead of directly implementing this interface.- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
- 
Method SummaryModifier and TypeMethodDescriptionGets the artifact identifier of this artifact, for example "maven-model".Gets the base version of this artifact, for example "1.0-SNAPSHOT".Gets the classifier of this artifact, for example "sources".Gets the (file) extension of this artifact, for example "jar" or "tar.gz".getFile()Deprecated.Gets the group identifier of this artifact, for example "org.apache.maven".getPath()Gets the file of this artifact.Gets the properties of this artifact.getProperty(String key, String defaultValue) Gets the specified property.Gets the version of this artifact, for example "1.0-20100529-1213".booleanDetermines whether this artifact uses a snapshot version.Deprecated.UsesetPath(Path)instead.Sets the file of the artifact.setProperties(Map<String, String> properties) Sets the properties for the artifact.setVersion(String version) Sets the version of the artifact.
- 
Method Details- 
getGroupIdGets the group identifier of this artifact, for example "org.apache.maven".- Returns:
- The group identifier, never null.
 
- 
getArtifactIdGets the artifact identifier of this artifact, for example "maven-model".- Returns:
- The artifact identifier, never null.
 
- 
getVersionGets 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. This may also return version ranges like "[1.0,2.0)". The exact syntax for (meta) versions and version ranges depends on the underlying provider (encapsulated inRepositorySystem).- Returns:
- The version, never null.
 
- 
setVersionSets the version of the artifact.- Parameters:
- version- The version of this artifact, may be- nullor empty.
- Returns:
- The new artifact, never null.
 
- 
getBaseVersionGets the base version of this artifact, for example "1.0-SNAPSHOT". In contrast to thegetVersion(), the base version will always refer to the unresolved meta version.- Returns:
- The base version, never null.
 
- 
isSnapshotboolean isSnapshot()Determines whether this artifact uses a snapshot version.- Returns:
- trueif the artifact is a snapshot,- falseotherwise.
 
- 
getClassifierGets the classifier of this artifact, for example "sources".- Returns:
- The classifier or an empty string if none, never null.
 
- 
getExtensionGets the (file) extension of this artifact, for example "jar" or "tar.gz".- Returns:
- The file extension (without leading period), never null.
 
- 
getFileDeprecated.UsegetPath()instead.Gets 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.
 
- 
getPathGets 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.
- Since:
- 2.0.0
 
- 
setFileDeprecated.UsesetPath(Path)instead.Sets the file of the artifact.- Parameters:
- file- The file of the artifact, may be- null
- Returns:
- The new artifact, never null.
 
- 
setPathSets the file of the artifact.- Parameters:
- path- The file of the artifact, may be- null
- Returns:
- The new artifact, never null.
- Since:
- 2.0.0
 
- 
getPropertyGets the specified property.- Parameters:
- key- The name of the property, must not be- null.
- defaultValue- The default value to return in case the property is not set, may be- null.
- Returns:
- The requested property value or nullif the property is not set and no default value was provided.
- See Also:
 
- 
getPropertiesGets 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:
 
- 
setPropertiesSets the properties for the artifact. Note that these properties exist merely in memory and are not persisted when the artifact gets installed/deployed to a repository.- Parameters:
- properties- The properties for the artifact, may be- null.
- Returns:
- The new artifact, never null.
- See Also:
 
 
- 
getPath()instead.