Package org.openrewrite.maven.graph
Class DependencyGraph
java.lang.Object
org.openrewrite.maven.graph.DependencyGraph
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildDependencyGraph(ResolvedGroupArtifactVersion gav, Map<ResolvedGroupArtifactVersion, List<DependencyGraph.DependencyPath>> projectPaths, int minDepth, String scopeOrConfiguration) Builds a complete dependency graph for the given GAV based on collected paths.buildInverseDependencyTree(ResolvedGroupArtifactVersion gav, Map<ResolvedGroupArtifactVersion, List<DependencyGraph.DependencyPath>> projectPaths, String scopeOrConfiguration) Builds an inverse dependency tree showing the path from a (potentially transitive) dependency up to the configuration that includes it.voidcollectGradleDependencyPaths(List<ResolvedDependency> dependencies, Map<ResolvedGroupArtifactVersion, List<DependencyGraph.DependencyPath>> paths, String scope) Collects dependency paths for Gradle dependencies.voidcollectMavenDependencyPaths(List<ResolvedDependency> dependencies, Map<ResolvedGroupArtifactVersion, List<DependencyGraph.DependencyPath>> paths, String scope) Collects dependency paths for Maven dependencies.render(ResolvedDependency dependency, String configuration) Renders a direct dependency graph showing just the dependency and its configuration.
-
Constructor Details
-
DependencyGraph
public DependencyGraph()
-
-
Method Details
-
collectMavenDependencyPaths
public void collectMavenDependencyPaths(List<ResolvedDependency> dependencies, Map<ResolvedGroupArtifactVersion, List<DependencyGraph.DependencyPath>> paths, String scope) Collects dependency paths for Maven dependencies. -
collectGradleDependencyPaths
public void collectGradleDependencyPaths(List<ResolvedDependency> dependencies, Map<ResolvedGroupArtifactVersion, List<DependencyGraph.DependencyPath>> paths, String scope) Collects dependency paths for Gradle dependencies. -
buildDependencyGraph
public String buildDependencyGraph(ResolvedGroupArtifactVersion gav, Map<ResolvedGroupArtifactVersion, List<DependencyGraph.DependencyPath>> projectPaths, int minDepth, String scopeOrConfiguration) Builds a complete dependency graph for the given GAV based on collected paths. Automatically determines whether to build a direct or inverse dependency tree.- Parameters:
gav- The dependency to build a graph forprojectPaths- Collected dependency pathsminDepth- Minimum depth of the dependency (0 for direct, >0 for transitive)scopeOrConfiguration- Maven scope name or Gradle configuration name to use as fallback
-
render
Renders a direct dependency graph showing just the dependency and its configuration. -
buildInverseDependencyTree
public String buildInverseDependencyTree(ResolvedGroupArtifactVersion gav, Map<ResolvedGroupArtifactVersion, List<DependencyGraph.DependencyPath>> projectPaths, String scopeOrConfiguration) Builds an inverse dependency tree showing the path from a (potentially transitive) dependency up to the configuration that includes it.
-