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
FieldsModifier and TypeFieldDescriptionprotected final org.eclipse.aether.artifact.Artifactprotected final Stringprotected final InternalSession -
Constructor Summary
ConstructorsConstructorDescriptionDefaultArtifact(InternalSession session, org.eclipse.aether.artifact.Artifact artifact) -
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.eclipse.aether.artifact.ArtifactReturns 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.inthashCode()booleanDetermines 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:ArtifactReturns a unique identifier for this artifact. The identifier is composed of groupId, artifactId, extension, classifier, and version. -
getGroupId
Description copied from interface:ArtifactReturns the group identifier of the artifact.- Specified by:
getGroupIdin interfaceArtifact- Returns:
- the group identifier of the artifact
- See Also:
-
getArtifactId
Description copied from interface:ArtifactReturns the identifier of the artifact.- Specified by:
getArtifactIdin interfaceArtifact- Returns:
- the identifier of the artifact
- See Also:
-
getVersion
Description copied from interface:ArtifactReturns the version of the artifact. Contrarily toArtifactCoordinates, eachArtifactis 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:
getVersionin interfaceArtifact- Returns:
- the version of the artifact
- See Also:
-
getBaseVersion
Description copied from interface:ArtifactReturns the version or meta-version of the artifact. A meta-version is a version suffixed with theSNAPSHOTkeyword. 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:
getBaseVersionin interfaceArtifact- Returns:
- the version or meta-version of the artifact
-
getExtension
Description copied from interface:ArtifactReturns the file extension of the artifact. The dot separator is not included in the returned string.- Specified by:
getExtensionin interfaceArtifact- Returns:
- the file extension or an empty string if none, never
null - See Also:
-
getClassifier
Description copied from interface:ArtifactReturns the classifier of the artifact.- Specified by:
getClassifierin interfaceArtifact- Returns:
- the classifier or an empty string if none, never
null - See Also:
-
isSnapshot
public boolean isSnapshot()Description copied from interface:ArtifactDetermines whether this artifact uses a snapshot version.- Specified by:
isSnapshotin interfaceArtifact- Returns:
trueif the artifact is a snapshot,falseotherwise- See Also:
-
toCoordinates
Description copied from interface:ArtifactReturns coordinates with the same identifiers as this artifact. This is a shortcut forsession.createArtifactCoordinates(artifact).- Specified by:
toCoordinatesin interfaceArtifact- Returns:
- coordinates with the same identifiers as this artifact
- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-