Interface Dependency
- All Superinterfaces:
Artifact
- All Known Subinterfaces:
DownloadedDependency
- All Known Implementing Classes:
DefaultDependency
A result of collecting, flattening, and resolving
DependencyCoordinates
s.
Dependency is the output of the collection process, which builds the graph of dependencies,
followed by flattening and resolution.
The version selection is done for each dependency during the collection phase.
The flatten phase keeps only a single version per (groupId
, artifactId
) pair.
The resolution phase actually downloads the dependencies (or artifacts) that have been computed.- Since:
- 4.0.0
-
Method Summary
Methods inherited from interface org.apache.maven.api.Artifact
getArtifactId, getBaseVersion, getClassifier, getExtension, getGroupId, getVersion, isSnapshot, key
-
Method Details
-
getType
-
getScope
Returns the time at which the dependency will be used. It may be, for example, at compile time only, at run time or at test time.- Returns:
- the time at which the dependency will be used
- See Also:
-
isOptional
boolean isOptional()Returns whether the dependency is optional or mandatory. UnlikeDependencyCoordinates
, the obligation of aDependency
is always present. The value is computed during the dependencies collection phase.- Returns:
true
if the dependency is optional, orfalse
if mandatory- See Also:
-
toCoordinates
Returns coordinates with the same identifiers as this dependency.- Specified by:
toCoordinates
in interfaceArtifact
- Returns:
- coordinates with the same identifiers as this dependency
- See Also:
-