Interface DependencyGraphBuilder

All Known Implementing Classes:
DefaultDependencyGraphBuilder, Maven2DependencyGraphBuilder

public interface DependencyGraphBuilder
Maven project dependency graph builder API, neutral against Maven 2 or Maven 3.
Since:
2.0
Author:
Hervé Boutemy
  • Method Summary

    Modifier and Type
    Method
    Description
    buildDependencyGraph(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.resolver.filter.ArtifactFilter filter)
    Build the dependency graph.
    buildDependencyGraph(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.resolver.filter.ArtifactFilter filter, Collection<org.apache.maven.project.MavenProject> reactorProjects)
    Build the dependency graph, with a hack to include dependencies contained in the reactor projects but that are not yet compiled, which is the minimum prerequisite for Maven core's ReactorReader to find them.
  • Method Details

    • buildDependencyGraph

      DependencyNode buildDependencyGraph(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.resolver.filter.ArtifactFilter filter) throws DependencyGraphBuilderException
      Build the dependency graph.
      Parameters:
      project - the project
      filter - artifact filter (can be null)
      Returns:
      the dependency graph
      Throws:
      DependencyGraphBuilderException - if some of the dependencies could not be resolved.
    • buildDependencyGraph

      DependencyNode buildDependencyGraph(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.resolver.filter.ArtifactFilter filter, Collection<org.apache.maven.project.MavenProject> reactorProjects) throws DependencyGraphBuilderException
      Build the dependency graph, with a hack to include dependencies contained in the reactor projects but that are not yet compiled, which is the minimum prerequisite for Maven core's ReactorReader to find them. Notice that this hack hasn't been done for Maven 2.

      Notice: If Maven core did collect instead of resolving dependencies (ie did not try to get the artifacts but only the poms), probably this hack wouldn't be necessary even for people requiring the dependency graph before compiling. TODO: for Maven 3, use Aether to collect dependencies.

      Parameters:
      project - the project
      filter - artifact filter (can be null)
      reactorProjects - Collection of those projects contained in the reactor (can be null).
      Returns:
      the dependency graph
      Throws:
      DependencyGraphBuilderException - if some of the dependencies could not be resolved.