Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
In maven-dependency-tree 2.x the DependencyGraphBuilder has 2 methods:
DependencyNode buildDependencyGraph( MavenProject project, ArtifactFilter filter ) throws DependencyGraphBuilderException; DependencyNode buildDependencyGraph( MavenProject project, ArtifactFilter filter, Collection<MavenProject> reactorProjects ) throws DependencyGraphBuilderException;
This was required to be Maven2 compatible but was not correct and efficient for Maven3.
Instead the first argument should be changed to ProjectBuildingRequest which contains both the MavenProject and Aethers RepositorySystemSession
Developers should upgrade their code to
@Parameter ( defaultValue="${session}", required=true, readOnly=true ) private MavenSession session; @Component private DependencyGraphBuilder dependencyGraphBuilder; ... public void doExecute() { ArtifactFilter filter = null; dependencyGraphBuilder.buildDependencyGraph( session.getProjectBuildingRequest(), filter ); }