Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-422

Change DependencyGraphBuilder method signatures

    XMLWordPrintableJSON

Details

    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 );
      }
      

      Attachments

        Activity

          People

            rfscholte Robert Scholte
            rfscholte Robert Scholte
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: