Package org.apache.maven.internal.impl
Class DefaultArtifact
java.lang.Object
org.apache.maven.internal.impl.DefaultArtifact
- All Implemented Interfaces:
Artifact
- Direct Known Subclasses:
DefaultDownloadedArtifact
,DefaultProducedArtifact
A wrapper class around a maven resolver artifact.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.eclipse.aether.artifact.Artifact
protected final String
protected final InternalSession
-
Constructor Summary
ConstructorDescriptionDefaultArtifact
(InternalSession session, org.eclipse.aether.artifact.Artifact artifact) -
Method Summary
Modifier and TypeMethodDescriptionboolean
org.eclipse.aether.artifact.Artifact
Returns the identifier of the artifact.Returns the version or meta-version of the artifact.Returns the classifier of the artifact.Returns the file extension of the artifact.Returns the group identifier of the artifact.Returns the version of the artifact.int
hashCode()
boolean
Determines whether this artifact uses a snapshot version.key()
Returns a unique identifier for this artifact.Returns coordinates with the same identifiers as this artifact.toString()
-
Field Details
-
session
-
artifact
-
key
-
-
Constructor Details
-
DefaultArtifact
public DefaultArtifact(@Nonnull InternalSession session, @Nonnull org.eclipse.aether.artifact.Artifact artifact)
-
-
Method Details
-
getArtifact
public org.eclipse.aether.artifact.Artifact getArtifact() -
key
Description copied from interface:Artifact
Returns a unique identifier for this artifact. The identifier is composed of groupId, artifactId, extension, classifier, and version. -
getGroupId
Description copied from interface:Artifact
Returns the group identifier of the artifact.- Specified by:
getGroupId
in interfaceArtifact
- Returns:
- the group identifier of the artifact
- See Also:
-
getArtifactId
Description copied from interface:Artifact
Returns the identifier of the artifact.- Specified by:
getArtifactId
in interfaceArtifact
- Returns:
- the identifier of the artifact
- See Also:
-
getVersion
Description copied from interface:Artifact
Returns the version of the artifact. Contrarily toArtifactCoordinates
, eachArtifact
is associated to a specific version instead of a range of versions. If the base version contains a meta-version such asSNAPSHOT
, those keywords are replaced by, for example, the actual timestamp.- Specified by:
getVersion
in interfaceArtifact
- Returns:
- the version of the artifact
- See Also:
-
getBaseVersion
Description copied from interface:Artifact
Returns the version or meta-version of the artifact. A meta-version is a version suffixed with theSNAPSHOT
keyword. Meta-versions are represented in a base version by their symbols (e.g.,SNAPSHOT
), while they are replaced by, for example, the actual timestamp in the version.- Specified by:
getBaseVersion
in interfaceArtifact
- Returns:
- the version or meta-version of the artifact
-
getExtension
Description copied from interface:Artifact
Returns the file extension of the artifact. The dot separator is not included in the returned string.- Specified by:
getExtension
in interfaceArtifact
- Returns:
- the file extension or an empty string if none, never
null
- See Also:
-
getClassifier
Description copied from interface:Artifact
Returns the classifier of the artifact.- Specified by:
getClassifier
in interfaceArtifact
- Returns:
- the classifier or an empty string if none, never
null
- See Also:
-
isSnapshot
public boolean isSnapshot()Description copied from interface:Artifact
Determines whether this artifact uses a snapshot version.- Specified by:
isSnapshot
in interfaceArtifact
- Returns:
true
if the artifact is a snapshot,false
otherwise- See Also:
-
toCoordinates
Description copied from interface:Artifact
Returns coordinates with the same identifiers as this artifact. This is a shortcut forsession.createArtifactCoordinates(artifact)
.- Specified by:
toCoordinates
in interfaceArtifact
- Returns:
- coordinates with the same identifiers as this artifact
- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-