public class DependencyGraph extends Object
Imagine performing a breadth first search starting with a given dependency and continuing through its dependencies, and accumulating the path to each node from the root as a list of dependencies. Although each path should appear only once, each dependency may appear many times in different paths. This representation is unusual because it represents a tree as a list of every path from the root to each node, instead of a network of nodes.
Artifacts are considered to be the same if they have the same group ID, artifact ID, and version.
| Constructor and Description |
|---|
DependencyGraph(org.eclipse.aether.graph.DependencyNode root) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPath(DependencyPath path) |
UnresolvableArtifactProblem |
createUnresolvableArtifactProblem(org.eclipse.aether.artifact.Artifact artifact)
Creates a problem describing that
artifact is unresolvable in this
dependency graph. |
List<Update> |
findUpdates()
Returns a list of updates indicating desired updates formatted for a person to read.
|
static DependencyGraph |
from(org.eclipse.aether.graph.DependencyNode root)
Builds a dependency graph by traversing dependency tree in level-order (breadth-first search).
|
List<DependencyPath> |
getChildren(DependencyPath parent)
Returns dependency paths from the root to the children of
parent. |
Map<String,String> |
getHighestVersionMap() |
Set<DependencyPath> |
getPaths(String coordinates)
Returns all paths to the specified artifact.
|
DependencyPath |
getRootPath()
Returns dependency path of the root node.
|
Set<UnresolvableArtifactProblem> |
getUnresolvedArtifacts()
Returns artifacts that could not be resolved during the construction of this graph.
|
List<DependencyPath> |
list()
Returns a mutable copy of the paths in this graph, usually in breadth first order.
|
public DependencyGraph(org.eclipse.aether.graph.DependencyNode root)
public void addPath(DependencyPath path)
public List<DependencyPath> list()
public DependencyPath getRootPath()
IllegalStateException - if the graph is emptypublic List<DependencyPath> getChildren(DependencyPath parent)
parent.public Set<DependencyPath> getPaths(String coordinates)
public List<Update> findUpdates()
public Map<String,String> getHighestVersionMap()
public Set<UnresolvableArtifactProblem> getUnresolvedArtifacts()
public UnresolvableArtifactProblem createUnresolvableArtifactProblem(org.eclipse.aether.artifact.Artifact artifact)
artifact is unresolvable in this
dependency graph.public static DependencyGraph from(org.eclipse.aether.graph.DependencyNode root)
root - node to start traversalCopyright © 2018–2021 Google LLC.. All rights reserved.