Package org.apache.maven.api
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 will keep only a single version per (groupId
, artifactId
) pair.
The resolution will actually download 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
Returns the type of the dependency. A dependency can be a JAR file, a modular-JAR if it is intended to be placed on the module-path, a JAR containing test classes, etc.- Returns:
- the type of the dependency
- See Also:
-
getScope
Returns the time at which the dependency will be used. If 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. Contrarily toDependencyCoordinates
, 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:
-