Class DefaultDependencyGraphBuilder

java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder
All Implemented Interfaces:
DependencyGraphBuilder, org.codehaus.plexus.logging.LogEnabled, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable

@Component(role=DependencyGraphBuilder.class) public class DefaultDependencyGraphBuilder extends org.codehaus.plexus.logging.AbstractLogEnabled implements DependencyGraphBuilder, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Default dependency graph builder that detects current Maven version to delegate to either Maven 2 or Maven 3 specific code.
Since:
2.0
Author:
Hervé Boutemy
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.codehaus.plexus.PlexusContainer
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    buildDependencyGraph(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.resolver.filter.ArtifactFilter filter)
    Builds a dependency graph.
    buildDependencyGraph(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.resolver.filter.ArtifactFilter filter, Collection<org.apache.maven.project.MavenProject> reactorProjects)
    Builds a dependency graph.
    void
    contextualize(org.codehaus.plexus.context.Context context)
    Injects the Plexus content.
    protected static boolean
     
    protected static boolean
     

    Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled

    enableLogging, getLogger, setupLogger, setupLogger, setupLogger

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • container

      protected org.codehaus.plexus.PlexusContainer container
  • Constructor Details

    • DefaultDependencyGraphBuilder

      public DefaultDependencyGraphBuilder()
  • Method Details

    • buildDependencyGraph

      public DependencyNode buildDependencyGraph(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.resolver.filter.ArtifactFilter filter) throws DependencyGraphBuilderException
      Builds a dependency graph.
      Specified by:
      buildDependencyGraph in interface DependencyGraphBuilder
      Parameters:
      project - the project
      filter - artifact filter (can be null)
      Returns:
      DependencyNode containing the dependency graph.
      Throws:
      DependencyGraphBuilderException - if some of the dependencies could not be resolved.
    • buildDependencyGraph

      public 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
      Builds a dependency graph.
      Specified by:
      buildDependencyGraph in interface DependencyGraphBuilder
      Parameters:
      project - the project
      filter - artifact filter (can be null)
      reactorProjects - Collection of those projects contained in the reactor (can be null)
      Returns:
      DependencyNode containing the dependency graph.
      Throws:
      DependencyGraphBuilderException - if some of the dependencies could not be resolved.
    • isMaven2x

      protected static boolean isMaven2x()
      Returns:
      true if the current Maven is Maven 2.x.
    • isMaven31

      protected static boolean isMaven31()
      Returns:
      true if the current Maven version is Maven 3.1.
    • contextualize

      public void contextualize(org.codehaus.plexus.context.Context context) throws org.codehaus.plexus.context.ContextException
      Injects the Plexus content.
      Specified by:
      contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
      Parameters:
      context - Plexus context to inject.
      Throws:
      org.codehaus.plexus.context.ContextException - if the PlexusContainer could not be located.