Interface DependencyNode
- All Known Implementing Classes:
DefaultDependencyNode
,VerboseDependencyNode
public interface DependencyNode
Represents an artifact node within a Maven project's dependency graph. Notice there is no support for omitted nodes
at the moment, only dependencies kept in the resolved dependency list are available.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(DependencyNodeVisitor visitor) Applies the specified dependency node visitor to this dependency node and its children.org.apache.maven.artifact.Artifact
List<org.apache.maven.model.Exclusion>
Gets the parent dependency node of this dependency node.Gets the scope for the dependency before dependency management was applied (if any).Gets the version or version range for the dependency before dependency management was applied (if any).A constraint on versions for a dependency.Returns a string representation of this dependency node.
-
Method Details
-
getArtifact
org.apache.maven.artifact.Artifact getArtifact()- Returns:
- Artifact for this DependencyNode.
-
getChildren
List<DependencyNode> getChildren()- Returns:
- children of this DependencyNode.
-
getParent
DependencyNode getParent()Gets the parent dependency node of this dependency node.- Returns:
- the parent dependency node
-
getPremanagedVersion
String getPremanagedVersion()Gets the version or version range for the dependency before dependency management was applied (if any).- Returns:
- The dependency version before dependency management or
null
if the version was not managed.
-
getPremanagedScope
String getPremanagedScope()Gets the scope for the dependency before dependency management was applied (if any).- Returns:
- The dependency scope before dependency management or
null
if the scope was not managed.
-
getVersionConstraint
String getVersionConstraint()A constraint on versions for a dependency. A constraint can either consist of one or more version ranges or a single version.- Returns:
- The constraint on the dependency.
-
toNodeString
String toNodeString()Returns a string representation of this dependency node.- Returns:
- the string representation
-
getOptional
Boolean getOptional()- Returns:
- true for an optional dependency.
-
getExclusions
List<org.apache.maven.model.Exclusion> getExclusions()- Returns:
- the exclusions of the dependency
-