[ 
https://issues.apache.org/jira/browse/MSHARED-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14952445#comment-14952445
 ] 

Hervé Boutemy commented on MSHARED-422:
---------------------------------------

I have one question:
I perfectly see the good idea of using ProjectBuildingRequest when calculating 
dependency tree for a project in reactor, to have exact same context

but what about calculating a dependency tree for anything else than a project 
in reactor?

> Change DependencyGraphBuilder method signatures
> -----------------------------------------------
>
>                 Key: MSHARED-422
>                 URL: https://issues.apache.org/jira/browse/MSHARED-422
>             Project: Maven Shared Components
>          Issue Type: Bug
>          Components: maven-dependency-tree
>            Reporter: Robert Scholte
>            Assignee: Robert Scholte
>             Fix For: maven-dependency-tree-3.0
>
>
> In maven-dependency-tree 2.x the {{DependencyGraphBuilder}} has 2 methods:
> {code}
> DependencyNode buildDependencyGraph( MavenProject project, ArtifactFilter 
> filter )
>         throws DependencyGraphBuilderException;
> DependencyNode buildDependencyGraph( MavenProject project, ArtifactFilter 
> filter,
>                                          Collection<MavenProject> 
> reactorProjects )
>         throws DependencyGraphBuilderException;
> {code}
> 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
> {code}
> @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 );
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to