Package org.apache.maven.impl
Class DefaultDependency
java.lang.Object
org.apache.maven.impl.DefaultDependency
- All Implemented Interfaces:
- Artifact,- Dependency
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultDependency(InternalSession session, org.eclipse.aether.graph.Dependency dependency) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns the artifact identifier of the wrapped dependency.Returns the version or meta-version of the artifact.Returns the classifier ("jar", "test-jar", …) of the wrapped dependency.Returns the file extension of the wrapped dependency.Returns the group identifier of the wrapped dependency.getScope()Returns the scope (compile, test, …) of this dependency.getType()Returns the type of the wrapped dependency.Returns the version of the artifact.inthashCode()booleanReturns whether the dependency is optional or mandatory.booleanDetermines whether this artifact uses a snapshot version.key()Returns a unique identifier for this artifact.Returns coordinates with the same identifiers as this dependency.toString()Returns a string representation of this dependency.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.maven.api.ArtifactgetArtifactId, getClassifier, getExtension, getGroupIdMethods inherited from interface org.apache.maven.api.DependencygetScope, getType
- 
Constructor Details- 
DefaultDependencypublic DefaultDependency(@Nonnull InternalSession session, @Nonnull org.eclipse.aether.graph.Dependency dependency) 
 
- 
- 
Method Details- 
keyDescription copied from interface:ArtifactReturns a unique identifier for this artifact. The identifier is composed of groupId, artifactId, extension, classifier, and version.
- 
getVersionDescription 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 interface- Artifact
- Returns:
- the version of the artifact
- See Also:
 
- 
getBaseVersionDescription 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 interface- Artifact
- Returns:
- the version or meta-version of the artifact
 
- 
isSnapshotpublic boolean isSnapshot()Description copied from interface:ArtifactDetermines whether this artifact uses a snapshot version.- Specified by:
- isSnapshotin interface- Artifact
- Returns:
- trueif the artifact is a snapshot,- falseotherwise
- See Also:
 
- 
isOptionalpublic boolean isOptional()Description copied from interface:DependencyReturns whether the dependency is optional or mandatory. Contrarily toDependencyCoordinates, the obligation of aDependencyis always present. The value is computed during the dependencies collection phase.- Specified by:
- isOptionalin interface- Dependency
- Returns:
- trueif the dependency is optional, or- falseif mandatory
- See Also:
 
- 
toCoordinatesDescription copied from interface:DependencyReturns coordinates with the same identifiers as this dependency.- Specified by:
- toCoordinatesin interface- Artifact
- Specified by:
- toCoordinatesin interface- Dependency
- Returns:
- coordinates with the same identifiers as this dependency
- See Also:
 
- 
equals
- 
hashCodepublic int hashCode()
- 
getGroupIdReturns the group identifier of the wrapped dependency. The default implementation delegates to the Eclipse Aether artifact.- Returns:
- the group identifier of the wrapped dependency
 
- 
getArtifactIdReturns the artifact identifier of the wrapped dependency. The default implementation delegates to the Eclipse Aether artifact.- Returns:
- the artifact identifier of the wrapped dependency
 
- 
getExtensionReturns the file extension of the wrapped dependency. The default implementation delegates to the Eclipse Aether artifact.- Returns:
- the file extension of the wrapped dependency
 
- 
getTypeReturns the type of the wrapped dependency. The default implementation infers the type from the properties associated to the Eclipse Aether artifact.- Returns:
- the type of the wrapped dependency
 
- 
getClassifierReturns the classifier ("jar", "test-jar", …) of the wrapped dependency. The default implementation first delegates to the Eclipse Aether artifact. If the latter does not provide a non-empty classifier, then the default value is determined by type.- Returns:
- the classifier ("jar", "test-jar", …) of the wrapped dependency
 
- 
getScopeReturns the scope (compile, test, …) of this dependency.- Returns:
- the scope (compile, test, …) of this dependency
 
- 
toStringReturns a string representation of this dependency. This is for debugging purposes only and may change in any future version.
 
-