maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject [maven-project-info-reports-plugin] 01/01: [MPIR-366] Drop Maven 2 support
Date Fri, 13 Apr 2018 11:10:30 GMT
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MPIR-366
in repository https://gitbox.apache.org/repos/asf/maven-project-info-reports-plugin.git

commit 0a470ab300083af1c84fb7a765073bceb46cfb6b
Author: rfscholte <rfscholte@apache.org>
AuthorDate: Fri Apr 13 13:10:20 2018 +0200

    [MPIR-366] Drop Maven 2 support
---
 pom.xml                                            |  54 ++++++++---
 .../site/custom/project-info-reports.properties    |  18 ++++
 src/it/full-pom/verify.bsh                         |  10 ++
 src/it/mpir-229/verify.groovy                      |   2 +-
 .../projectinfo/AbstractProjectInfoReport.java     |  24 +++--
 .../report/projectinfo/CiManagementReport.java     |   1 -
 .../report/projectinfo/DependenciesReport.java     |  29 +++---
 .../projectinfo/DependencyConvergenceReport.java   |  47 +++------
 .../projectinfo/DependencyInformationReport.java   |   1 -
 .../projectinfo/DependencyManagementReport.java    |  30 +++---
 .../projectinfo/DistributionManagementReport.java  |   1 -
 .../maven/report/projectinfo/IndexReport.java      |   9 +-
 .../report/projectinfo/IssueManagementReport.java  |   1 -
 .../maven/report/projectinfo/LicensesReport.java   |   1 -
 .../report/projectinfo/MailingListsReport.java     |  34 +------
 .../maven/report/projectinfo/ModulesReport.java    |  18 ++--
 .../report/projectinfo/PluginManagementReport.java |  60 +++++-------
 .../maven/report/projectinfo/PluginsReport.java    |  60 ++++++------
 .../report/projectinfo/ProjectInfoReportUtils.java |  59 ++----------
 .../apache/maven/report/projectinfo/ScmReport.java |   1 -
 .../maven/report/projectinfo/SummaryReport.java    |   1 -
 .../maven/report/projectinfo/TeamReport.java       |   4 -
 .../projectinfo/dependencies/Dependencies.java     |   1 -
 .../DependenciesReportConfiguration.java           |   1 -
 .../dependencies/DependencyVersionMap.java         |   1 -
 .../dependencies/ManagementDependencies.java       |   1 -
 .../projectinfo/dependencies/RepositoryUtils.java  | 107 +++++----------------
 .../renderer/DependenciesRenderer.java             |  61 ++++--------
 .../renderer/DependencyManagementRenderer.java     |  40 ++++----
 .../projectinfo/AbstractProjectInfoTestCase.java   |  64 ++++++------
 .../report/projectinfo/ModulesReportTest.java      |   3 +-
 .../projectinfo/stubs/ProjectInfoProjectStub.java  |   5 +-
 32 files changed, 320 insertions(+), 429 deletions(-)

diff --git a/pom.xml b/pom.xml
index ecdd8ce..a0a4b39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,7 +119,7 @@ under the License.
   <properties>
     <doxiaVersion>1.6</doxiaVersion>
     <doxia-sitetoolsVersion>1.6</doxia-sitetoolsVersion>
-    <mavenVersion>2.2.1</mavenVersion>
+    <mavenVersion>3.0</mavenVersion>
     <scmVersion>1.9.5</scmVersion>
     <sitePluginVersion>3.5.1</sitePluginVersion>
   </properties>
@@ -133,33 +133,35 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-impl</artifactId>
-      <version>2.4</version>
+      <version>3.0.0</version>
     </dependency>
 
     <!-- Maven -->
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact</artifactId>
+      <artifactId>maven-compat</artifactId>
       <version>${mavenVersion}</version>
+      <scope>test</scope>
     </dependency>
+    
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact-manager</artifactId>
+      <artifactId>maven-artifact</artifactId>
       <version>${mavenVersion}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-model</artifactId>
+      <artifactId>maven-core</artifactId>
       <version>${mavenVersion}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
+      <artifactId>maven-model</artifactId>
       <version>${mavenVersion}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
+      <artifactId>maven-plugin-api</artifactId>
       <version>${mavenVersion}</version>
     </dependency>
     <dependency>
@@ -196,7 +198,12 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-common-artifact-filters</artifactId>
-      <version>1.4</version>
+      <version>3.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-artifact-transfer</artifactId>
+      <version>0.9.1</version>
     </dependency>
 
     <!-- SCM -->
@@ -322,11 +329,6 @@ under the License.
       <artifactId>plexus-interpolation</artifactId>
       <version>1.24</version>
     </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-container-default</artifactId>
-      <version>1.0-alpha-9-stable-1</version>
-    </dependency>
 
     <!-- Test -->
     <dependency>
@@ -338,13 +340,19 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.plugin-testing</groupId>
       <artifactId>maven-plugin-testing-harness</artifactId>
-      <version>1.3</version>
+      <version>2.1</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>3.8.2</version>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <version>2.12.0</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -359,6 +367,18 @@ under the License.
       <version>6.1.26</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.sonatype.aether</groupId>
+      <artifactId>aether-connector-wagon</artifactId>
+      <version>1.7</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-http-lightweight</artifactId>
+      <version>2.10</version>
+      <scope>runtime</scope>
+    </dependency>
 
     <!-- Anything else -->
     <dependency>
@@ -530,12 +550,16 @@ under the License.
     </profile>
     <profile>
       <id>run-its</id>
+      <properties>
+        <maven.invoker.failure.ignore>false</maven.invoker.failure.ignore>
+      </properties>
       <build>
         <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-invoker-plugin</artifactId>
             <configuration>
+              <ignoreFailures>${maven.invoker.failure.ignore}</ignoreFailures>
               <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
               <pomIncludes>
                 <pomInclude>*/pom.xml</pomInclude>
diff --git a/src/it/full-pom/src/site/custom/project-info-reports.properties b/src/it/full-pom/src/site/custom/project-info-reports.properties
new file mode 100644
index 0000000..644d0b9
--- /dev/null
+++ b/src/it/full-pom/src/site/custom/project-info-reports.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+report.mailing-lists.intro = mail list intro text foo
\ No newline at end of file
diff --git a/src/it/full-pom/verify.bsh b/src/it/full-pom/verify.bsh
index 369aae3..d49f305 100644
--- a/src/it/full-pom/verify.bsh
+++ b/src/it/full-pom/verify.bsh
@@ -107,6 +107,16 @@ try
         System.err.println( "MPIR-216: dependency-management doesn't contain doxia-sink-api url http://maven.apache.org/doxia/doxia/doxia-sink-api/" );
         return false;
     }
+    
+    File dependencyConvergence = new File( siteDir, "dependency-convergence.html");
+    content = FileUtils.fileRead( dependencyConvergence, "UTF-8" );
+    
+    if ( !content.contains( "You do not have 100% convergence." ) )
+    {
+        System.err.println( "dependency-convergence not rendered correctly" );
+        return false;
+    }
+    
 }
 catch ( Throwable t )
 {
diff --git a/src/it/mpir-229/verify.groovy b/src/it/mpir-229/verify.groovy
index b6080f9..efd9543 100644
--- a/src/it/mpir-229/verify.groovy
+++ b/src/it/mpir-229/verify.groovy
@@ -17,4 +17,4 @@
  * under the License.
  */
 File modulesPage = new File( basedir, 'target/site/modules.html' )
-assert modulesPage.text.contains( '<a href="mpir-229-module1-1.0-SNAPSHOT/index.html">mpir-229-module1</a>' )
\ No newline at end of file
+assert modulesPage.text.contains( '<a href="mpir-229-module1-1.0-SNAPSHOT/index.html" title="mpir-229-module1">mpir-229-module1</a>' )
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java b/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
index 2647551..59121db 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
@@ -37,9 +37,7 @@ import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.doxia.site.decoration.Body;
 import org.apache.maven.doxia.site.decoration.DecorationModel;
 import org.apache.maven.doxia.siterenderer.Renderer;
@@ -49,15 +47,18 @@ import org.apache.maven.doxia.siterenderer.SiteRenderingContext;
 import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
 import org.apache.maven.doxia.tools.SiteTool;
 import org.apache.maven.doxia.tools.SiteToolException;
+import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.reporting.AbstractMavenReport;
 import org.apache.maven.reporting.MavenReportException;
+import org.apache.maven.repository.RepositorySystem;
 import org.apache.maven.settings.Settings;
+import org.apache.maven.shared.artifact.resolve.ArtifactResolver;
 import org.codehaus.plexus.i18n.I18N;
 import org.codehaus.plexus.interpolation.EnvarBasedValueSource;
 import org.codehaus.plexus.interpolation.InterpolationException;
@@ -72,7 +73,6 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
  * Base class with the things that should be in AbstractMavenReport anyway.
  *
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
- * @version $Id$
  * @since 2.0
  */
 public abstract class AbstractProjectInfoReport
@@ -106,7 +106,7 @@ public abstract class AbstractProjectInfoReport
      * Artifact Factory component.
      */
     @Component
-    protected ArtifactFactory factory;
+    RepositorySystem repositorySystem;
 
     /**
      * Internationalization component, could support also custom bundle using {@link #customBundle}.
@@ -114,12 +114,8 @@ public abstract class AbstractProjectInfoReport
     @Component
     private I18N i18n;
 
-    /**
-     * Project builder (deprecated in Maven 3: should use ProjectBuilder, which will avoid
-     * issues like DOXIASITETOOLS-166)
-     */
     @Component
-    protected MavenProjectBuilder mavenProjectBuilder;
+    protected ProjectBuilder projectBuilder;
 
     // ----------------------------------------------------------------------
     // Mojo parameters
@@ -138,6 +134,9 @@ public abstract class AbstractProjectInfoReport
      */
     @Parameter( defaultValue = "${project}", readonly = true, required = true )
     protected MavenProject project;
+    
+    @Parameter( defaultValue = "${session}", readonly = true, required = true )
+    private MavenSession session;
 
     /**
      * Local Repository.
@@ -320,6 +319,11 @@ public abstract class AbstractProjectInfoReport
     {
         return project;
     }
+    
+    protected MavenSession getSession()
+    {
+        return session;
+    }
 
     /**
      * Reactor projects
diff --git a/src/main/java/org/apache/maven/report/projectinfo/CiManagementReport.java b/src/main/java/org/apache/maven/report/projectinfo/CiManagementReport.java
index b2e674b..fad1d19 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/CiManagementReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/CiManagementReport.java
@@ -34,7 +34,6 @@ import java.util.Locale;
  * Generates the Project Continuous Integration Management report.
  *
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "cim" )
diff --git a/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java b/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java
index 76f8028..ffd9b62 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java
@@ -28,8 +28,8 @@ import java.io.InputStreamReader;
 import java.io.LineNumberReader;
 import java.io.OutputStream;
 import java.util.Locale;
+
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
 import org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
@@ -38,11 +38,14 @@ import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.report.projectinfo.dependencies.Dependencies;
 import org.apache.maven.report.projectinfo.dependencies.DependenciesReportConfiguration;
 import org.apache.maven.report.projectinfo.dependencies.RepositoryUtils;
 import org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer;
+import org.apache.maven.repository.RepositorySystem;
 import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder;
 import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException;
 import org.apache.maven.shared.dependency.graph.DependencyNode;
@@ -55,7 +58,6 @@ import org.codehaus.plexus.util.ReaderFactory;
  *
  * @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "dependencies", requiresDependencyResolution = ResolutionScope.TEST )
@@ -75,7 +77,7 @@ public class DependenciesReport
      * Maven Project Builder component.
      */
     @Component
-    private MavenProjectBuilder mavenProjectBuilder;
+    private ProjectBuilder projectBuilder;
 
     /**
      * Artifact metadata source component.
@@ -113,7 +115,7 @@ public class DependenciesReport
      * @since 2.1
      */
     @Component
-    private ArtifactFactory artifactFactory;
+    private RepositorySystem repositorySystem;
 
     // ----------------------------------------------------------------------
     // Mojo parameters
@@ -158,11 +160,16 @@ public class DependenciesReport
         {
             getLog().error( "Cannot copy ressources", e );
         }
-
-        @SuppressWarnings( "unchecked" ) RepositoryUtils repoUtils =
-            new RepositoryUtils( getLog(), mavenProjectBuilder, factory, resolver,
+        
+        ProjectBuildingRequest buildingRequest =
+            new DefaultProjectBuildingRequest( getSession().getProjectBuildingRequest() );
+        buildingRequest.setLocalRepository( localRepository );
+        buildingRequest.setRemoteRepositories( remoteRepositories );
+
+        RepositoryUtils repoUtils =
+            new RepositoryUtils( getLog(), projectBuilder, repositorySystem, resolver,
                                  project.getRemoteArtifactRepositories(), project.getPluginArtifactRepositories(),
-                                 localRepository, repositoryMetadataManager );
+                                 buildingRequest, repositoryMetadataManager );
 
         DependencyNode dependencyNode = resolveProject();
 
@@ -173,8 +180,8 @@ public class DependenciesReport
 
         DependenciesRenderer r =
             new DependenciesRenderer( getSink(), locale, getI18N( locale ), getLog(), dependencies,
-                                      dependencyNode, config, repoUtils, artifactFactory, mavenProjectBuilder,
-                                      remoteRepositories, localRepository );
+                                      dependencyNode, config, repoUtils, repositorySystem, projectBuilder,
+                                      buildingRequest );
         r.render();
     }
 
diff --git a/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java b/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java
index 85ec81e..f6738b4 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/DependencyConvergenceReport.java
@@ -33,9 +33,6 @@ import java.util.Set;
 import java.util.TreeMap;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.resolver.ArtifactCollector;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.SinkEventAttributeSet;
@@ -44,13 +41,15 @@ import org.apache.maven.model.Dependency;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.report.projectinfo.dependencies.DependencyVersionMap;
 import org.apache.maven.report.projectinfo.dependencies.SinkSerializingDependencyNodeVisitor;
 import org.apache.maven.reporting.MavenReportException;
 import org.apache.maven.shared.artifact.filter.StrictPatternIncludesArtifactFilter;
-import org.apache.maven.shared.dependency.tree.DependencyNode;
 import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
+import org.apache.maven.shared.dependency.tree.DependencyNode;
 import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
 import org.apache.maven.shared.dependency.tree.filter.AncestorOrSelfDependencyNodeFilter;
 import org.apache.maven.shared.dependency.tree.filter.AndDependencyNodeFilter;
@@ -67,7 +66,6 @@ import org.apache.maven.shared.dependency.tree.traversal.FilteringDependencyNode
  * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
  * @author <a href="mailto:wangyf2010@gmail.com">Simon Wang </a>
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "dependency-convergence", aggregator = true )
@@ -96,28 +94,9 @@ public class DependencyConvergenceReport
      * Dependency tree builder, will use it to build dependency tree.
      */
     @Component
-    DependencyTreeBuilder dependencyTreeBuilder;
-
-    /**
-     * Use it to build dependency(artifact) tree
-     */
-    @Component
-    ArtifactFactory factory;
-
-    /**
-     * Use it to get artifact metadata source for dependency tree building.
-     */
-    @Component
-    ArtifactMetadataSource metadataSource;
-
-    /**
-     * Artifact collector - takes a set of original artifacts and resolves all of the best versions to use along with
-     * their metadata.
-     */
-    @Component
-    ArtifactCollector collector;
+    private DependencyTreeBuilder dependencyTreeBuilder;
 
-    ArtifactFilter filter = null;
+    private ArtifactFilter filter = null;
 
     private Map<MavenProject, DependencyNode> projectMap = new HashMap<MavenProject, DependencyNode>();
 
@@ -767,9 +746,14 @@ public class DependencyConvergenceReport
             new TreeMap<String, List<ReverseDependencyLink>>();
         Map<String, List<ReverseDependencyLink>> allDependencies = new TreeMap<String, List<ReverseDependencyLink>>();
 
+        ProjectBuildingRequest buildingRequest =
+            new DefaultProjectBuildingRequest( getSession().getProjectBuildingRequest() );
+        
         for ( MavenProject reactorProject : reactorProjects )
         {
-            DependencyNode node = getNode( reactorProject );
+            buildingRequest.setProject( reactorProject );
+            
+            DependencyNode node = getNode( buildingRequest );
 
             this.projectMap.put( reactorProject, node );
 
@@ -921,18 +905,19 @@ public class DependencyConvergenceReport
     /**
      * Get root node of dependency tree for a given project
      *
-     * @param project
+     * @param buildingRequest
      * @return root node of dependency tree
      * @throws MavenReportException
      */
-    private DependencyNode getNode( MavenProject project )
+    private DependencyNode getNode( ProjectBuildingRequest buildingRequest )
         throws MavenReportException
     {
         try
         {
             DependencyNode node =
-                (DependencyNode) dependencyTreeBuilder.buildDependencyTree( project, localRepository, factory,
-                                                                            metadataSource, filter, collector );
+                (DependencyNode) dependencyTreeBuilder.buildDependencyTree( buildingRequest.getProject(),
+                                                                            localRepository,
+                                                                            filter );
 
             return node;
         }
diff --git a/src/main/java/org/apache/maven/report/projectinfo/DependencyInformationReport.java b/src/main/java/org/apache/maven/report/projectinfo/DependencyInformationReport.java
index 2178dfd..59e2d63 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/DependencyInformationReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/DependencyInformationReport.java
@@ -32,7 +32,6 @@ import java.util.Locale;
  * Generates code snippets to be added to build tools.
  *
  * @author <a href="mailto:simonetripodi@apache.org">Simone Tripodi</a>
- * @version $Id$
  * @since 2.5
  */
 @Mojo( name = "dependency-info" )
diff --git a/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java b/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
index b6ce4b7..ce494c9 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
@@ -19,24 +19,25 @@ package org.apache.maven.report.projectinfo;
  * under the License.
  */
 
-import org.apache.maven.artifact.factory.ArtifactFactory;
+import java.util.Locale;
+
 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
 import org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.report.projectinfo.dependencies.ManagementDependencies;
 import org.apache.maven.report.projectinfo.dependencies.RepositoryUtils;
 import org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer;
-
-import java.util.Locale;
+import org.apache.maven.repository.RepositorySystem;
 
 /**
  * Generates the Project Dependency Management report.
  *
  * @author Nick Stolwijk
- * @version $Id$
  * @since 2.1
  */
 @Mojo( name = "dependency-management", requiresDependencyResolution = ResolutionScope.TEST )
@@ -51,7 +52,7 @@ public class DependencyManagementReport
      * Maven Project Builder component.
      */
     @Component
-    private MavenProjectBuilder mavenProjectBuilder;
+    private ProjectBuilder projectBuilder;
 
     /**
      * Artifact metadata source component.
@@ -65,7 +66,7 @@ public class DependencyManagementReport
      * Maven Artifact Factory component.
      */
     @Component
-    private ArtifactFactory artifactFactory;
+    private RepositorySystem repositorySystem;
 
     /**
      * Repository metadata component.
@@ -103,15 +104,20 @@ public class DependencyManagementReport
     @Override
     public void executeReport( Locale locale )
     {
-        @SuppressWarnings( "unchecked" ) RepositoryUtils repoUtils =
-            new RepositoryUtils( getLog(), mavenProjectBuilder, factory, resolver,
+        ProjectBuildingRequest buildingRequest =
+            new DefaultProjectBuildingRequest( getSession().getProjectBuildingRequest() );
+        buildingRequest.setLocalRepository( localRepository );
+        buildingRequest.setRemoteRepositories( remoteRepositories );
+        
+        RepositoryUtils repoUtils =
+            new RepositoryUtils( getLog(), projectBuilder, repositorySystem, resolver,
                                  project.getRemoteArtifactRepositories(), project.getPluginArtifactRepositories(),
-                                 localRepository, repositoryMetadataManager );
+                                 buildingRequest, repositoryMetadataManager );
 
         DependencyManagementRenderer r =
             new DependencyManagementRenderer( getSink(), locale, getI18N( locale ), getLog(),
-                                              getManagementDependencies(), artifactMetadataSource, artifactFactory,
-                                              mavenProjectBuilder, remoteRepositories, localRepository, repoUtils );
+                                              getManagementDependencies(), artifactMetadataSource, repositorySystem,
+                                              projectBuilder, buildingRequest, repoUtils );
         r.render();
     }
 
diff --git a/src/main/java/org/apache/maven/report/projectinfo/DistributionManagementReport.java b/src/main/java/org/apache/maven/report/projectinfo/DistributionManagementReport.java
index 365b6ad..48a39a7 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/DistributionManagementReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/DistributionManagementReport.java
@@ -32,7 +32,6 @@ import java.util.Locale;
  * Generates the Project Distribution Management report.
  *
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
- * @version $Id$
  * @since 2.3
  */
 @Mojo( name = "distribution-management" )
diff --git a/src/main/java/org/apache/maven/report/projectinfo/IndexReport.java b/src/main/java/org/apache/maven/report/projectinfo/IndexReport.java
index 5c59c1d..305a41e 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/IndexReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/IndexReport.java
@@ -25,7 +25,7 @@ import org.apache.maven.doxia.tools.SiteTool;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
 import org.codehaus.plexus.i18n.I18N;
 
 import java.util.List;
@@ -36,7 +36,6 @@ import java.util.Locale;
  *
  * @author <a href="mailto:brett@apache.org">Brett Porter </a>
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "index" )
@@ -72,7 +71,7 @@ public class IndexReport
     @Override
     public void executeReport( Locale locale )
     {
-        ProjectIndexRenderer r = new ProjectIndexRenderer( project, getReactorProjects(), mavenProjectBuilder,
+        ProjectIndexRenderer r = new ProjectIndexRenderer( project, getReactorProjects(), projectBuilder,
                                                            localRepository, getName( locale ), getDescription( locale ),
                                                            getSink(), getI18N( locale ), locale, getLog(), siteTool );
 
@@ -108,10 +107,10 @@ public class IndexReport
         private boolean modules = false;
 
         ProjectIndexRenderer( MavenProject project, List<MavenProject> reactorProjects,
-                              MavenProjectBuilder mavenProjectBuilder, ArtifactRepository localRepository, String title,
+                              ProjectBuilder projectBuilder, ArtifactRepository localRepository, String title,
                               String description, Sink sink, I18N i18n, Locale locale, Log log, SiteTool siteTool )
         {
-            super( sink, project, reactorProjects, mavenProjectBuilder, localRepository, i18n, locale, log, siteTool );
+            super( sink, project, reactorProjects, projectBuilder, localRepository, i18n, locale, log, siteTool );
 
             this.title = title;
 
diff --git a/src/main/java/org/apache/maven/report/projectinfo/IssueManagementReport.java b/src/main/java/org/apache/maven/report/projectinfo/IssueManagementReport.java
index 48379d1..e849c9c 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/IssueManagementReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/IssueManagementReport.java
@@ -32,7 +32,6 @@ import java.util.Locale;
  * Generates the Project Issue Management report.
  *
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "issue-tracking" )
diff --git a/src/main/java/org/apache/maven/report/projectinfo/LicensesReport.java b/src/main/java/org/apache/maven/report/projectinfo/LicensesReport.java
index cd73cd4..15baca4 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/LicensesReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/LicensesReport.java
@@ -43,7 +43,6 @@ import java.util.regex.Pattern;
  * Generates the Project Licenses report.
  *
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "license" )
diff --git a/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java b/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java
index 8e4b28e..d2342f0 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java
@@ -24,7 +24,6 @@ import org.apache.maven.model.MailingList;
 import org.apache.maven.model.Model;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
 import org.codehaus.plexus.i18n.I18N;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -38,23 +37,12 @@ import java.util.Locale;
  *
  * @author <a href="mailto:brett@apache.org">Brett Porter </a>
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "mailing-list" )
 public class MailingListsReport
     extends AbstractProjectInfoReport
 {
-
-    /**
-     * This can override the header text of the mailing list(s) report
-     *
-     * @since 2.2
-     * @deprecated since 2.3, you should use a custom bundle.
-     */
-    @Parameter
-    protected String introduction;
-
     // ----------------------------------------------------------------------
     // Public methods
     // ----------------------------------------------------------------------
@@ -75,8 +63,7 @@ public class MailingListsReport
     public void executeReport( Locale locale )
     {
         MailingListsRenderer r =
-            new MailingListsRenderer( getSink(), getProject().getModel(), getI18N( locale ), locale, introduction,
-                                      getLog() );
+            new MailingListsRenderer( getSink(), getProject().getModel(), getI18N( locale ), locale, getLog() );
 
         r.render();
     }
@@ -105,22 +92,16 @@ public class MailingListsReport
     protected static class MailingListsRenderer
         extends AbstractProjectInfoRenderer
     {
-        private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
         private final Model model;
 
-        private final String introduction;
-
         private final Log log;
 
-        MailingListsRenderer( Sink sink, Model model, I18N i18n, Locale locale, String introduction, Log log )
+        MailingListsRenderer( Sink sink, Model model, I18N i18n, Locale locale, Log log )
         {
             super( sink, i18n, locale );
 
             this.model = model;
 
-            this.introduction = introduction;
-
             this.log = log;
         }
 
@@ -148,16 +129,7 @@ public class MailingListsReport
 
             startSection( getTitle() );
 
-            if ( StringUtils.isNotBlank( introduction ) )
-            {
-                log.warn( "Since 2.3, the <introduction/> parameter is deprecated. Please use a <customBundle/>"
-                    + " parameter to configure a custom bundle." );
-                paragraph( introduction );
-            }
-            else
-            {
-                paragraph( getI18nString( "intro" ) );
-            }
+            paragraph( getI18nString( "intro" ) );
 
             startTable();
 
diff --git a/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java b/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
index ff0d370..e02298a 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java
@@ -32,16 +32,17 @@ import org.apache.maven.model.DistributionManagement;
 import org.apache.maven.model.Site;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.ProjectBuildingRequest;
 import org.codehaus.plexus.i18n.I18N;
 
 /**
  * Generates the Project Modules report.
  *
  * @author ltheussl
- * @version $Id$
  * @since 2.2
  */
 @Mojo( name = "modules" )
@@ -67,7 +68,7 @@ public class ModulesReport
     @Override
     public void executeReport( Locale locale )
     {
-        new ModulesRenderer( getSink(), getProject(), getReactorProjects(), mavenProjectBuilder, localRepository,
+        new ModulesRenderer( getSink(), getProject(), getReactorProjects(), projectBuilder, localRepository,
                              getI18N( locale ), locale, getLog(), siteTool ).render();
     }
 
@@ -100,21 +101,21 @@ public class ModulesReport
 
         protected List<MavenProject> reactorProjects;
 
-        protected MavenProjectBuilder mavenProjectBuilder;
+        protected ProjectBuilder projectBuilder;
 
         protected ArtifactRepository localRepository;
 
         protected SiteTool siteTool;
 
         ModulesRenderer( Sink sink, MavenProject project, List<MavenProject> reactorProjects,
-                         MavenProjectBuilder mavenProjectBuilder, ArtifactRepository localRepository, I18N i18n,
+                         ProjectBuilder projectBuilder, ArtifactRepository localRepository, I18N i18n,
                          Locale locale, Log log, SiteTool siteTool )
         {
             super( sink, i18n, locale );
 
             this.project = project;
             this.reactorProjects = reactorProjects;
-            this.mavenProjectBuilder = mavenProjectBuilder;
+            this.projectBuilder = projectBuilder;
             this.localRepository = localRepository;
             this.siteTool = siteTool;
             this.log = log;
@@ -154,6 +155,9 @@ public class ModulesReport
 
             final String baseUrl = getDistMgmntSiteUrl( project );
 
+            ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest();
+            buildingRequest.setLocalRepository( localRepository );
+            
             for ( String module : modules )
             {
                 MavenProject moduleProject = getModuleFromReactor( project, reactorProjects, module );
@@ -167,7 +171,7 @@ public class ModulesReport
                     {
                         try
                         {
-                            moduleProject = mavenProjectBuilder.build( f, localRepository, null );
+                            moduleProject = projectBuilder.build( f, buildingRequest ).getProject();
                         }
                         catch ( ProjectBuildingException e )
                         {
diff --git a/src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java b/src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java
index 1052ad9..e46e457 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java
@@ -20,8 +20,6 @@ package org.apache.maven.report.projectinfo;
  */
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.model.Plugin;
@@ -30,13 +28,15 @@ import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.repository.RepositorySystem;
 import org.codehaus.plexus.i18n.I18N;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
@@ -46,7 +46,6 @@ import java.util.Locale;
  * Generates the Project Plugin Management report.
  *
  * @author Nick Stolwijk
- * @version $Id$
  * @since 2.1
  */
 @Mojo( name = "plugin-management", requiresDependencyResolution = ResolutionScope.TEST )
@@ -61,13 +60,7 @@ public class PluginManagementReport
      * Maven Project Builder component.
      */
     @Component
-    private MavenProjectBuilder mavenProjectBuilder;
-
-    /**
-     * Maven Artifact Factory component.
-     */
-    @Component
-    private ArtifactFactory artifactFactory;
+    private ProjectBuilder projectBuilder;
 
     // ----------------------------------------------------------------------
     // Public methods
@@ -78,8 +71,8 @@ public class PluginManagementReport
     {
         PluginManagementRenderer r =
             new PluginManagementRenderer( getLog(), getSink(), locale, getI18N( locale ),
-                                          project.getPluginManagement().getPlugins(), project, mavenProjectBuilder,
-                                          artifactFactory, localRepository );
+                                          project.getPluginManagement().getPlugins(), project, projectBuilder,
+                                          repositorySystem, getSession().getProjectBuildingRequest() );
         r.render();
     }
 
@@ -126,11 +119,11 @@ public class PluginManagementReport
 
         private final MavenProject project;
 
-        private final MavenProjectBuilder mavenProjectBuilder;
+        private final ProjectBuilder projectBuilder;
 
-        private final ArtifactFactory artifactFactory;
+        private final RepositorySystem repositorySystem;
 
-        private final ArtifactRepository localRepository;
+        private final ProjectBuildingRequest buildingRequest;
 
         /**
          * @param log {@link #log}
@@ -139,13 +132,13 @@ public class PluginManagementReport
          * @param i18n {@link I18N}
          * @param plugins {@link Plugin}
          * @param project {@link MavenProject}
-         * @param mavenProjectBuilder {@link MavenProjectBuilder}
-         * @param artifactFactory {@link ArtifactFactory}
-         * @param localRepository {@link ArtifactRepository}
+         * @param projectBuilder {@link ProjectBuilder}
+         * @param repositorySystem {@link RepositorySystem}
+         * @param buildingRequest {@link ArtifactRepository}
          */
         public PluginManagementRenderer( Log log, Sink sink, Locale locale, I18N i18n, List<Plugin> plugins,
-                                         MavenProject project, MavenProjectBuilder mavenProjectBuilder,
-                                         ArtifactFactory artifactFactory, ArtifactRepository localRepository )
+                                         MavenProject project, ProjectBuilder projectBuilder,
+                                         RepositorySystem repositorySystem, ProjectBuildingRequest buildingRequest )
         {
             super( sink, i18n, locale );
 
@@ -155,11 +148,11 @@ public class PluginManagementReport
 
             this.project = project;
 
-            this.mavenProjectBuilder = mavenProjectBuilder;
+            this.projectBuilder = projectBuilder;
 
-            this.artifactFactory = artifactFactory;
+            this.repositorySystem = repositorySystem;
 
-            this.localRepository = localRepository;
+            this.buildingRequest = buildingRequest;
         }
 
         @Override
@@ -201,6 +194,9 @@ public class PluginManagementReport
             startTable();
             tableHeader( tableHeader );
 
+            ProjectBuildingRequest buildRequest = new DefaultProjectBuildingRequest( buildingRequest );
+            buildRequest.setRemoteRepositories( project.getPluginArtifactRepositories() );
+            
             for ( Plugin plugin : pluginManagement )
             {
                 VersionRange versionRange;
@@ -213,19 +209,13 @@ public class PluginManagementReport
                     versionRange = VersionRange.createFromVersion( plugin.getVersion() );
                 }
 
-                Artifact pluginArtifact = artifactFactory.createParentArtifact( plugin.getGroupId(), plugin
+                Artifact pluginArtifact = repositorySystem.createProjectArtifact( plugin.getGroupId(), plugin
                     .getArtifactId(), versionRange.toString() );
-                @SuppressWarnings( "unchecked" )
-                List<ArtifactRepository> artifactRepositories = project.getPluginArtifactRepositories();
-                if ( artifactRepositories == null )
-                {
-                    artifactRepositories = new ArrayList<ArtifactRepository>();
-                }
+
                 try
                 {
-                    MavenProject pluginProject = mavenProjectBuilder.buildFromRepository( pluginArtifact,
-                                                                                          artifactRepositories,
-                                                                                          localRepository );
+                    MavenProject pluginProject = projectBuilder.build( pluginArtifact, buildingRequest ).getProject();
+                    
                     tableRow( getPluginRow( pluginProject.getGroupId(), pluginProject.getArtifactId(), pluginProject
                         .getVersion(), pluginProject.getUrl() ) );
                 }
diff --git a/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java b/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java
index a4bc0dd..1c2159a 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/PluginsReport.java
@@ -26,7 +26,6 @@ import java.util.List;
 import java.util.Locale;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.doxia.sink.Sink;
@@ -36,9 +35,12 @@ import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.repository.RepositorySystem;
 import org.codehaus.plexus.i18n.I18N;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -46,7 +48,6 @@ import org.codehaus.plexus.util.StringUtils;
  * Generates the Project Plugins report.
  *
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
- * @version $Id$
  * @since 2.1
  */
 @Mojo( name = "plugins", requiresDependencyResolution = ResolutionScope.TEST )
@@ -61,13 +62,13 @@ public class PluginsReport
      * Maven Project Builder component.
      */
     @Component
-    private MavenProjectBuilder mavenProjectBuilder;
+    private ProjectBuilder projectBuilder;
 
     /**
      * Maven Artifact Factory component.
      */
     @Component
-    private ArtifactFactory artifactFactory;
+    private RepositorySystem repositorySystem;
 
     // ----------------------------------------------------------------------
     // Public methods
@@ -88,11 +89,10 @@ public class PluginsReport
     @Override
     public void executeReport( Locale locale )
     {
-        @SuppressWarnings( "unchecked" )
         PluginsRenderer r =
             new PluginsRenderer( getLog(), getSink(), locale, getI18N( locale ), project.getBuildPlugins(),
-                                 project.getReportPlugins(), project, mavenProjectBuilder, artifactFactory,
-                                 localRepository );
+                                 project.getReportPlugins(), project, projectBuilder, repositorySystem,
+                                 getSession().getProjectBuildingRequest() );
         r.render();
     }
 
@@ -126,11 +126,11 @@ public class PluginsReport
 
         private final MavenProject project;
 
-        private final MavenProjectBuilder mavenProjectBuilder;
+        private final ProjectBuilder projectBuilder;
 
-        private final ArtifactFactory artifactFactory;
+        private final RepositorySystem repositorySystem;
 
-        private final ArtifactRepository localRepository;
+        private final ProjectBuildingRequest buildingRequest;
 
         /**
          * @param log {@link #log}
@@ -140,15 +140,15 @@ public class PluginsReport
          * @param plugins {@link Artifact}
          * @param reports {@link Artifact}
          * @param project {@link MavenProject}
-         * @param mavenProjectBuilder {@link MavenProjectBuilder}
-         * @param artifactFactory {@link ArtifactFactory}
+         * @param projectBuilder {@link ProjectBuilder}
+         * @param repositorySystem {@link RepositorySystem}
          * @param localRepository {@link ArtifactRepository}
          *
          */
         public PluginsRenderer( Log log, Sink sink, Locale locale, I18N i18n, List<Plugin> plugins,
                                 List<ReportPlugin> reports, MavenProject project,
-                                MavenProjectBuilder mavenProjectBuilder, ArtifactFactory artifactFactory,
-                                ArtifactRepository localRepository )
+                                ProjectBuilder projectBuilder, RepositorySystem repositorySystem,
+                                ProjectBuildingRequest buildingRequest )
         {
             super( sink, i18n, locale );
 
@@ -160,11 +160,11 @@ public class PluginsReport
 
             this.project = project;
 
-            this.mavenProjectBuilder = mavenProjectBuilder;
+            this.projectBuilder = projectBuilder;
 
-            this.artifactFactory = artifactFactory;
+            this.repositorySystem = repositorySystem;
 
-            this.localRepository = localRepository;
+            this.buildingRequest = buildingRequest;
         }
 
         @Override
@@ -190,6 +190,7 @@ public class PluginsReport
         private void renderSectionPlugins( boolean isPlugins )
         {
             List<GAV> list = isPlugins ? GAV.pluginsToGAV( plugins ) : GAV.reportPluginsToGAV( reports, project );
+            
             String[] tableHeader = getPluginTableHeader();
 
             startSection( getI18nString( isPlugins ? "build.title" : "report.title" ) );
@@ -207,24 +208,27 @@ public class PluginsReport
             startTable();
             tableHeader( tableHeader );
 
+            List<ArtifactRepository> artifactRepositories = project.getPluginArtifactRepositories();
+            if ( artifactRepositories == null )
+            {
+                artifactRepositories = new ArrayList<ArtifactRepository>();
+            }
+
+            ProjectBuildingRequest buildRequest = new DefaultProjectBuildingRequest( buildingRequest );
+            buildRequest.setRemoteRepositories( artifactRepositories );
+            
             for ( GAV plugin : list )
             {
                 VersionRange versionRange = VersionRange.createFromVersion( plugin.getVersion() );
 
+                
                 Artifact pluginArtifact =
-                    artifactFactory.createParentArtifact( plugin.getGroupId(), plugin.getArtifactId(),
+                                repositorySystem.createProjectArtifact( plugin.getGroupId(), plugin.getArtifactId(),
                                                           versionRange.toString() );
-                @SuppressWarnings( "unchecked" )
-                List<ArtifactRepository> artifactRepositories = project.getPluginArtifactRepositories();
-                if ( artifactRepositories == null )
-                {
-                    artifactRepositories = new ArrayList<ArtifactRepository>();
-                }
                 try
                 {
-                    MavenProject pluginProject = mavenProjectBuilder.buildFromRepository( pluginArtifact,
-                                                                                          artifactRepositories,
-                                                                                          localRepository );
+                    MavenProject pluginProject = projectBuilder.build( pluginArtifact, buildRequest ).getProject();
+
                     tableRow( getPluginRow( pluginProject.getGroupId(), pluginProject.getArtifactId(), pluginProject
                                             .getVersion(), pluginProject.getUrl() ) );
                 }
diff --git a/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java b/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java
index 1bdce16..50d581c 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java
@@ -29,8 +29,6 @@ import java.security.KeyManagementException;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 import java.security.cert.X509Certificate;
-import java.util.Collections;
-import java.util.List;
 import java.util.Properties;
 
 import javax.net.ssl.HostnameVerifier;
@@ -41,18 +39,17 @@ import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 
-import org.apache.commons.lang.math.NumberUtils;
 import org.apache.commons.validator.routines.RegexValidator;
 import org.apache.commons.validator.routines.UrlValidator;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactUtils;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.ProjectBuildingRequest;
 // CHECKSTYLE_OFF: UnusedImports
 import org.apache.maven.reporting.AbstractMavenReportRenderer;
+import org.apache.maven.repository.RepositorySystem;
 // CHECKSTYLE_ON: UnusedImports
 import org.apache.maven.settings.Proxy;
 import org.apache.maven.settings.Server;
@@ -214,16 +211,12 @@ public class ProjectInfoReportUtils
     /**
      * @param factory not null
      * @param artifact not null
-     * @param mavenProjectBuilder not null
-     * @param remoteRepositories not null
-     * @param localRepository not null
+     * @param projectBuilder not null
+     * @param buildingRequest not null
      * @return the artifact url or null if an error occurred.
      */
-    // CHECKSTYLE_OFF: LineLength
-    public static String getArtifactUrl( ArtifactFactory factory, Artifact artifact,
-                                         MavenProjectBuilder mavenProjectBuilder,
-                                         List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
-    // CHECKSTYLE_ON: LineLength
+    public static String getArtifactUrl( RepositorySystem repositorySystem, Artifact artifact,
+                                         ProjectBuilder projectBuilder, ProjectBuildingRequest buildingRequest )
     {
         if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) )
         {
@@ -234,15 +227,12 @@ public class ProjectInfoReportUtils
         if ( !"pom".equals( copyArtifact.getType() ) )
         {
             copyArtifact =
-                factory.createProjectArtifact( copyArtifact.getGroupId(), copyArtifact.getArtifactId(),
-                                               copyArtifact.getVersion(), copyArtifact.getScope() );
+                repositorySystem.createProjectArtifact( copyArtifact.getGroupId(), copyArtifact.getArtifactId(),
+                                                        copyArtifact.getVersion() );
         }
         try
         {
-            MavenProject pluginProject =
-                mavenProjectBuilder.buildFromRepository( copyArtifact,
-                                                         remoteRepositories == null ? Collections.EMPTY_LIST
-                                                                         : remoteRepositories, localRepository );
+            MavenProject pluginProject = projectBuilder.build( copyArtifact, buildingRequest ).getProject();
 
             if ( isArtifactUrlValid( pluginProject.getUrl() ) )
             {
@@ -389,33 +379,4 @@ public class ProjectInfoReportUtils
 
         return conn;
     }
-
-    /**
-     * @param str The string to be checked.
-     * @return true if is number false otherwise.
-     */
-    @Deprecated
-    public static boolean isNumber( String str )
-    {
-        if ( str.startsWith( "+" ) )
-        {
-            str = str.substring( 1 );
-        }
-        return NumberUtils.isNumber( str );
-    }
-
-    /**
-     * @param str The string which should be converted.
-     * @param defaultValue The default value.
-     * @return Converted string.
-     */
-    @Deprecated
-    public static float toFloat( String str, float defaultValue )
-    {
-        if ( str.startsWith( "+" ) )
-        {
-            str = str.substring( 1 );
-        }
-        return NumberUtils.toFloat( str, defaultValue );
-    }
 }
diff --git a/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java b/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java
index f64c951..3508e55 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java
@@ -48,7 +48,6 @@ import java.util.Locale;
  * Generates the Project Source Code Management (SCM) report.
  *
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "scm" )
diff --git a/src/main/java/org/apache/maven/report/projectinfo/SummaryReport.java b/src/main/java/org/apache/maven/report/projectinfo/SummaryReport.java
index cfafb68..a99ce06 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/SummaryReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/SummaryReport.java
@@ -37,7 +37,6 @@ import java.util.Locale;
  * Generates the Project Summary report.
  *
  * @author Edwin Punzalan
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "summary" )
diff --git a/src/main/java/org/apache/maven/report/projectinfo/TeamReport.java b/src/main/java/org/apache/maven/report/projectinfo/TeamReport.java
index 0d526cf..efd30e6 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/TeamReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/TeamReport.java
@@ -41,7 +41,6 @@ import org.codehaus.plexus.util.StringUtils;
  * Generates the Project Team report.
  *
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton </a>
- * @version $Id$
  * @since 2.0
  */
 @Mojo( name = "project-team" )
@@ -135,8 +134,6 @@ public class TeamReport
 
         private final Model model;
 
-        private final Log log;
-
         private final boolean showAvatarImages;
 
         private final String protocol;
@@ -146,7 +143,6 @@ public class TeamReport
             super( sink, i18n, locale );
 
             this.model = model;
-            this.log = log;
             this.showAvatarImages = showAvatarImages;
 
             // prepare protocol for gravatar
diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/Dependencies.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/Dependencies.java
index 5290428..6e8b0a9 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/Dependencies.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/Dependencies.java
@@ -37,7 +37,6 @@ import org.apache.maven.shared.jar.classes.JarClassesAnalysis;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
- * @version $Id$
  * @since 2.1
  */
 public class Dependencies
diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/DependenciesReportConfiguration.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/DependenciesReportConfiguration.java
index db3f2ea..82127fc 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/DependenciesReportConfiguration.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/DependenciesReportConfiguration.java
@@ -22,7 +22,6 @@ package org.apache.maven.report.projectinfo.dependencies;
 /**
  * Wrap DependenciesReport Mojo parameters.
  *
- * @version $Id$
  * @since 2.1
  */
 public class DependenciesReportConfiguration
diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/DependencyVersionMap.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/DependencyVersionMap.java
index f7f3e6e..5b17d41 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/DependencyVersionMap.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/DependencyVersionMap.java
@@ -30,7 +30,6 @@ import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor;
 
 /**
  * @author Simon Wang
- * @version $Id$
  * @since 2.8
  */
 public class DependencyVersionMap
diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/ManagementDependencies.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/ManagementDependencies.java
index 5b43d1b..7f407f9 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/ManagementDependencies.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/ManagementDependencies.java
@@ -29,7 +29,6 @@ import org.apache.maven.model.Dependency;
 
 /**
  * @author Nick Stolwijk
- * @version $Id$
  * @since 2.1
  */
 public class ManagementDependencies
diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
index 81ead9d..bad2d99 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
@@ -24,21 +24,18 @@ import java.util.List;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactUtils;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.metadata.Metadata;
 import org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager;
-import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata;
-import org.apache.maven.artifact.repository.metadata.Versioning;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
-import org.codehaus.plexus.util.StringUtils;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.repository.RepositorySystem;
+import org.apache.maven.shared.artifact.resolve.ArtifactResolver;
+import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;
+import org.apache.maven.shared.artifact.resolve.ArtifactResult;
 
 /**
  * Utilities methods to play with repository
@@ -50,9 +47,9 @@ public class RepositoryUtils
 {
     private final Log log;
 
-    private final MavenProjectBuilder mavenProjectBuilder;
+    private final ProjectBuilder projectBuilder;
 
-    private final ArtifactFactory factory;
+    private final RepositorySystem repositorySystem;
 
     private final List<ArtifactRepository> remoteRepositories;
 
@@ -60,7 +57,7 @@ public class RepositoryUtils
 
     private final ArtifactResolver resolver;
 
-    private final ArtifactRepository localRepository;
+    private final ProjectBuildingRequest buildingRequest;
 
     /**
      * @param log {@link Log}
@@ -72,59 +69,37 @@ public class RepositoryUtils
      * @param localRepository {@link ArtifactRepository}
      * @param repositoryMetadataManager {@link RepositoryMetadataManager}
      */
-    public RepositoryUtils( Log log, MavenProjectBuilder mavenProjectBuilder, ArtifactFactory factory,
+    public RepositoryUtils( Log log, ProjectBuilder projectBuilder, RepositorySystem repositorySystem,
                             ArtifactResolver resolver, List<ArtifactRepository> remoteRepositories,
-                            List<ArtifactRepository> pluginRepositories, ArtifactRepository localRepository,
+                            List<ArtifactRepository> pluginRepositories, ProjectBuildingRequest buildingRequest,
                             RepositoryMetadataManager repositoryMetadataManager )
     {
         this.log = log;
-        this.mavenProjectBuilder = mavenProjectBuilder;
-        this.factory = factory;
+        this.projectBuilder = projectBuilder;
+        this.repositorySystem = repositorySystem;
         this.resolver = resolver;
         this.remoteRepositories = remoteRepositories;
         this.pluginRepositories = pluginRepositories;
-        this.localRepository = localRepository;
-    }
-
-    /**
-     * @return localrepo
-     */
-    public ArtifactRepository getLocalRepository()
-    {
-        return localRepository;
-    }
-
-    /**
-     * @return remote artifact repo
-     */
-    public List<ArtifactRepository> getRemoteArtifactRepositories()
-    {
-        return remoteRepositories;
-    }
-
-    /**
-     * @return plugin artifact repo
-     */
-    public List<ArtifactRepository> getPluginArtifactRepositories()
-    {
-        return pluginRepositories;
+        this.buildingRequest = buildingRequest;
     }
 
     /**
      * @param artifact not null
-     * @throws ArtifactResolutionException if any
-     * @throws ArtifactNotFoundException if any
-     * @see ArtifactResolver#resolve(Artifact, List, ArtifactRepository)
+     * @throws ArtifactResolverException if any 
      */
     public void resolve( Artifact artifact )
-        throws ArtifactResolutionException, ArtifactNotFoundException
+        throws ArtifactResolverException
     {
         List<ArtifactRepository> repos =
             new ArrayList<ArtifactRepository>( pluginRepositories.size() + remoteRepositories.size() );
         repos.addAll( pluginRepositories );
         repos.addAll( remoteRepositories );
 
-        resolver.resolve( artifact, repos, localRepository );
+        ProjectBuildingRequest buildRequest = new DefaultProjectBuildingRequest( buildingRequest );
+        buildRequest.setRemoteRepositories( repos );
+
+        ArtifactResult result = resolver.resolveArtifact( buildRequest , artifact );
+        artifact.setFile( result.getArtifact().getFile() );
     }
 
     /**
@@ -142,14 +117,12 @@ public class RepositoryUtils
         boolean allowStubModel = false;
         if ( !"pom".equals( artifact.getType() ) )
         {
-            projectArtifact = factory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(),
-                                                             artifact.getVersion(), artifact.getScope() );
+            projectArtifact = repositorySystem.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(),
+                                                             artifact.getVersion() );
             allowStubModel = true;
         }
 
-        // TODO: we should use the MavenMetadataSource instead
-        return mavenProjectBuilder.buildFromRepository( projectArtifact, remoteRepositories, localRepository,
-                                                        allowStubModel );
+        return projectBuilder.build( projectArtifact, allowStubModel, buildingRequest ).getProject();
     }
 
     /**
@@ -178,38 +151,10 @@ public class RepositoryUtils
                     {
                         resolve( artifact );
                     }
-                    catch ( ArtifactResolutionException e )
+                    catch ( ArtifactResolverException e )
                     {
                         log.error( "Artifact: " + artifact.getId() + " could not be resolved." );
                     }
-                    catch ( ArtifactNotFoundException e )
-                    {
-                        log.error( "Artifact: " + artifact.getId() + " was not found." );
-                    }
-                }
-
-                for ( ArtifactMetadata m : artifact.getMetadataList() )
-                {
-                    if ( m instanceof SnapshotArtifactRepositoryMetadata )
-                    {
-                        SnapshotArtifactRepositoryMetadata snapshotMetadata = (SnapshotArtifactRepositoryMetadata) m;
-
-                        Metadata metadata = snapshotMetadata.getMetadata();
-                        Versioning versioning = metadata.getVersioning();
-                        if ( versioning == null || versioning.getSnapshot() == null
-                            || versioning.getSnapshot().isLocalCopy()
-                            || versioning.getSnapshot().getTimestamp() == null )
-                        {
-                            continue;
-                        }
-
-                        // create the version according SnapshotTransformation
-                        String version =
-                            StringUtils.replace( copyArtifact.getVersion(), Artifact.SNAPSHOT_VERSION,
-                                                 versioning.getSnapshot().getTimestamp() )
-                                + "-" + versioning.getSnapshot().getBuildNumber();
-                        copyArtifact.setVersion( version );
-                    }
                 }
             }
         }
diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
index 87a2f93..189100c 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
@@ -40,10 +40,6 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.SinkEventAttributeSet;
 import org.apache.maven.doxia.sink.SinkEventAttributes;
@@ -51,13 +47,16 @@ import org.apache.maven.doxia.util.HtmlTools;
 import org.apache.maven.model.License;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.report.projectinfo.AbstractProjectInfoRenderer;
 import org.apache.maven.report.projectinfo.ProjectInfoReportUtils;
 import org.apache.maven.report.projectinfo.dependencies.Dependencies;
 import org.apache.maven.report.projectinfo.dependencies.DependenciesReportConfiguration;
 import org.apache.maven.report.projectinfo.dependencies.RepositoryUtils;
+import org.apache.maven.repository.RepositorySystem;
+import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;
 import org.apache.maven.shared.dependency.graph.DependencyNode;
 import org.apache.maven.shared.jar.JarData;
 import org.codehaus.plexus.i18n.I18N;
@@ -126,13 +125,11 @@ public class DependenciesRenderer
         }
     };
 
-    private final ArtifactFactory artifactFactory;
+    private final RepositorySystem repositorySystem;
 
-    private final MavenProjectBuilder mavenProjectBuilder;
+    private final ProjectBuilder projectBuilder;
 
-    private final List<ArtifactRepository> remoteRepositories;
-
-    private final ArtifactRepository localRepository;
+    private final ProjectBuildingRequest buildingRequest;
 
     static
     {
@@ -148,6 +145,8 @@ public class DependenciesRenderer
     }
 
     /**
+     * 
+    /**
      * Default constructor.
      *
      * @param sink {@link Sink}
@@ -158,16 +157,15 @@ public class DependenciesRenderer
      * @param dependencyTreeNode {@link DependencyNode}
      * @param config {@link DependenciesReportConfiguration}
      * @param repoUtils {@link RepositoryUtils}
-     * @param artifactFactory {@link ArtifactFactory}
-     * @param mavenProjectBuilder {@link MavenProjectBuilder}
-     * @param remoteRepositories {@link ArtifactRepository}
-     * @param localRepository {@link ArtifactRepository}
+     * @param repositorySystem {@link RepositorySystem}
+     * @param projectBuilder {@link ProjectBuilder}
+     * @param buildingRequest {@link ProjectBuildingRequest}
      */
     public DependenciesRenderer( Sink sink, Locale locale, I18N i18n, Log log, 
                                  Dependencies dependencies, DependencyNode dependencyTreeNode,
                                  DependenciesReportConfiguration config, RepositoryUtils repoUtils,
-                                 ArtifactFactory artifactFactory, MavenProjectBuilder mavenProjectBuilder,
-                                 List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
+                                 RepositorySystem repositorySystem, ProjectBuilder projectBuilder,
+                                 ProjectBuildingRequest buildingRequest )
     {
         super( sink, i18n, locale );
 
@@ -176,10 +174,9 @@ public class DependenciesRenderer
         this.dependencyNode = dependencyTreeNode;
         this.repoUtils = repoUtils;
         this.configuration = config;
-        this.artifactFactory = artifactFactory;
-        this.mavenProjectBuilder = mavenProjectBuilder;
-        this.remoteRepositories = remoteRepositories;
-        this.localRepository = localRepository;
+        this.repositorySystem = repositorySystem;
+        this.projectBuilder = projectBuilder;
+        this.buildingRequest = buildingRequest;
 
         // Using the right set of symbols depending of the locale
         DEFAULT_DECIMAL_FORMAT.setDecimalFormatSymbols( new DecimalFormatSymbols( locale ) );
@@ -790,8 +787,7 @@ public class DependenciesRenderer
             artifact.isOptional() ? getI18nString( "column.isOptional" ) : getI18nString( "column.isNotOptional" );
 
         String url =
-            ProjectInfoReportUtils.getArtifactUrl( artifactFactory, artifact, mavenProjectBuilder, remoteRepositories,
-                                                   localRepository );
+            ProjectInfoReportUtils.getArtifactUrl( repositorySystem, artifact, projectBuilder, buildingRequest );
         String artifactIdCell = ProjectInfoReportUtils.getArtifactIdCell( artifact.getArtifactId(), url );
 
         MavenProject artifactProject;
@@ -799,7 +795,7 @@ public class DependenciesRenderer
         try
         {
             artifactProject = repoUtils.getMavenProjectFromRepository( artifact );
-            @SuppressWarnings( "unchecked" )
+
             List<License> licenses = artifactProject.getLicenses();
             for ( License license : licenses )
             {
@@ -893,7 +889,7 @@ public class DependenciesRenderer
                 String artifactDescription = artifactProject.getDescription();
                 String artifactUrl = artifactProject.getUrl();
                 String artifactName = artifactProject.getName();
-                @SuppressWarnings( "unchecked" )
+
                 List<License> licenses = artifactProject.getLicenses();
 
                 sink.tableRow();
@@ -1081,26 +1077,11 @@ public class DependenciesRenderer
                 {
                     repoUtils.resolve( artifact );
                 }
-                catch ( ArtifactResolutionException e )
+                catch ( ArtifactResolverException e )
                 {
                     log.error( "Artifact " + artifact.getId() + " can't be resolved.", e );
                     continue;
                 }
-                catch ( ArtifactNotFoundException e )
-                {
-                    if ( ( dependencies.getProject().getGroupId().equals( artifact.getGroupId() ) )
-                        && ( dependencies.getProject().getArtifactId().equals( artifact.getArtifactId() ) )
-                        && ( dependencies.getProject().getVersion().equals( artifact.getVersion() ) ) )
-                    {
-                        log.warn( "The artifact of this project has never been deployed." );
-                    }
-                    else
-                    {
-                        log.error( "Artifact " + artifact.getId() + " not found.", e );
-                    }
-
-                    continue;
-                }
 
                 if ( artifact.getFile() == null )
                 {
diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java
index efd5fe9..eb6f83e 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java
@@ -27,10 +27,8 @@ import java.util.Locale;
 import java.util.Map;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.artifact.versioning.VersionRange;
@@ -39,18 +37,19 @@ import org.apache.maven.model.Dependency;
 import org.apache.maven.model.License;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.report.projectinfo.AbstractProjectInfoRenderer;
 import org.apache.maven.report.projectinfo.ProjectInfoReportUtils;
 import org.apache.maven.report.projectinfo.dependencies.ManagementDependencies;
 import org.apache.maven.report.projectinfo.dependencies.RepositoryUtils;
+import org.apache.maven.repository.RepositorySystem;
 import org.codehaus.plexus.i18n.I18N;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
  * @author Nick Stolwijk
- * @version $Id$
  * @since 2.1
  */
 public class DependencyManagementRenderer
@@ -62,13 +61,11 @@ public class DependencyManagementRenderer
 
     private final ArtifactMetadataSource artifactMetadataSource;
 
-    private final ArtifactFactory artifactFactory;
+    private final RepositorySystem repositorySystem;
 
-    private final MavenProjectBuilder mavenProjectBuilder;
+    private final ProjectBuilder projectBuilder;
 
-    private final List<ArtifactRepository> remoteRepositories;
-
-    private final ArtifactRepository localRepository;
+    private final ProjectBuildingRequest buildingRequest;
 
     private final RepositoryUtils repoUtils;
 
@@ -81,8 +78,8 @@ public class DependencyManagementRenderer
      * @param log {@link Log}
      * @param dependencies {@link ManagementDependencies}
      * @param artifactMetadataSource {@link ArtifactMetadataSource}
-     * @param artifactFactory {@link ArtifactFactory}
-     * @param mavenProjectBuilder {@link MavenProjectBuilder}
+     * @param repositorySystem {@link RepositorySystem}
+     * @param projectBuilder {@link ProjectBuilder}
      * @param remoteRepositories {@link ArtifactRepository}
      * @param localRepository {@link ArtifactRepository}
      * @param repoUtils {@link RepositoryUtils}
@@ -90,19 +87,17 @@ public class DependencyManagementRenderer
     public DependencyManagementRenderer( Sink sink, Locale locale, I18N i18n, Log log,
                                          ManagementDependencies dependencies,
                                          ArtifactMetadataSource artifactMetadataSource,
-                                         ArtifactFactory artifactFactory, MavenProjectBuilder mavenProjectBuilder,
-                                         List<ArtifactRepository> remoteRepositories,
-                                         ArtifactRepository localRepository, RepositoryUtils repoUtils )
+                                         RepositorySystem repositorySystem, ProjectBuilder projectBuilder,
+                                         ProjectBuildingRequest buildingRequest, RepositoryUtils repoUtils )
     {
         super( sink, i18n, locale );
 
         this.log = log;
         this.dependencies = dependencies;
         this.artifactMetadataSource = artifactMetadataSource;
-        this.artifactFactory = artifactFactory;
-        this.mavenProjectBuilder = mavenProjectBuilder;
-        this.remoteRepositories = remoteRepositories;
-        this.localRepository = localRepository;
+        this.repositorySystem = repositorySystem;
+        this.projectBuilder = projectBuilder;
+        this.buildingRequest = buildingRequest;
         this.repoUtils = repoUtils;
     }
 
@@ -217,7 +212,7 @@ public class DependencyManagementRenderer
     private String[] getDependencyRow( Dependency dependency, boolean hasClassifier )
     {
         Artifact artifact =
-            artifactFactory.createProjectArtifact( dependency.getGroupId(), dependency.getArtifactId(),
+            repositorySystem.createProjectArtifact( dependency.getGroupId(), dependency.getArtifactId(),
                                                    dependency.getVersion() );
 
         StringBuilder licensesBuffer = new StringBuilder();
@@ -232,7 +227,8 @@ public class DependencyManagementRenderer
                 log.debug( "Resolving range for DependencyManagement on " + artifact.getId() );
 
                 List<ArtifactVersion> versions =
-                    artifactMetadataSource.retrieveAvailableVersions( artifact, localRepository, remoteRepositories );
+                    artifactMetadataSource.retrieveAvailableVersions( artifact, buildingRequest.getLocalRepository(),
+                                                                      buildingRequest.getRemoteRepositories() );
 
                 // only use versions from range
                 for ( Iterator<ArtifactVersion> iter = versions.iterator(); iter.hasNext(); )
@@ -253,9 +249,7 @@ public class DependencyManagementRenderer
                 }
             }
 
-            url =
-                ProjectInfoReportUtils.getArtifactUrl( artifactFactory, artifact, mavenProjectBuilder,
-                                                       remoteRepositories, localRepository );
+            url = ProjectInfoReportUtils.getArtifactUrl( repositorySystem, artifact, projectBuilder, buildingRequest );
 
             MavenProject artifactProject = repoUtils.getMavenProjectFromRepository( artifact );
 
diff --git a/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java b/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java
index f7ae9bc..7dde513 100644
--- a/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java
+++ b/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java
@@ -19,18 +19,23 @@ package org.apache.maven.report.projectinfo;
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.util.Locale;
+
+import org.apache.maven.plugin.LegacySupport;
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.profiles.DefaultProfileManager;
-import org.apache.maven.profiles.ProfileManager;
+import org.apache.maven.plugin.testing.ArtifactStubFactory;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.report.projectinfo.stubs.DependencyArtifactStubFactory;
 import org.codehaus.plexus.i18n.I18N;
 import org.codehaus.plexus.util.StringUtils;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Locale;
+import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
+import org.sonatype.aether.util.DefaultRepositorySystemSession;
 
 /**
  * Abstract class to test reports generation with <a href="http://www.httpunit.org/">HTTPUnit</a> framework.
@@ -42,6 +47,8 @@ import java.util.Locale;
 public abstract class AbstractProjectInfoTestCase
     extends AbstractMojoTestCase
 {
+    private ArtifactStubFactory artifactStubFactory;
+    
     /**
      * The default locale is English.
      */
@@ -64,31 +71,16 @@ public abstract class AbstractProjectInfoTestCase
         // required for mojo lookups to work
         super.setUp();
 
-        i18n = (I18N) getContainer().lookup( I18N.ROLE );
-
-        File f = new File( getBasedir(), "target/local-repo/" );
-        f.mkdirs();
+        i18n = getContainer().lookup( I18N.class );
+        setVariableValueToObject( i18n, "defaultBundleName", "project-info-reports" );
 
+        artifactStubFactory = new DependencyArtifactStubFactory( getTestFile( "target" ), true, false );
+        artifactStubFactory.getWorkingDir().mkdirs();
+        
         // Set the default Locale
         Locale.setDefault( DEFAULT_LOCALE );
     }
 
-    protected InputStream getCustomConfiguration()
-        throws Exception
-    {
-        // Allow sub classes to have their own configuration...
-        if ( super.getConfiguration() == null )
-        {
-            String className = AbstractProjectInfoTestCase.class.getName();
-
-            String config = className.substring( className.lastIndexOf( "." ) + 1 ) + ".xml";
-
-            return AbstractProjectInfoTestCase.class.getResourceAsStream( config );
-        }
-
-        return null;
-    }
-
     @Override
     protected void tearDown()
         throws Exception
@@ -187,6 +179,14 @@ public abstract class AbstractProjectInfoTestCase
     {
         AbstractProjectInfoReport mojo = (AbstractProjectInfoReport) lookupMojo( goal, pluginXmlFile );
         assertNotNull( "Mojo found.", mojo );
+        
+        LegacySupport legacySupport = lookup( LegacySupport.class );
+        legacySupport.setSession( newMavenSession( new MavenProjectStub() ) );
+        DefaultRepositorySystemSession repoSession =
+            (DefaultRepositorySystemSession) legacySupport.getRepositorySession();
+        repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( artifactStubFactory.getWorkingDir() ) );
+
+        setVariableValueToObject( mojo, "session", legacySupport.getSession() );
 
         setVariableValueToObject( mojo, "remoteRepositories", mojo.project.getRemoteArtifactRepositories() );
         return mojo;
@@ -197,11 +197,13 @@ public abstract class AbstractProjectInfoTestCase
     {
         mojo.execute();
 
-        MavenProjectBuilder builder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );
-        ProfileManager profileManager = new DefaultProfileManager( getContainer(), null, null );
+        ProjectBuilder builder = lookup( ProjectBuilder.class );
+        
+        ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest();
+        buildingRequest.setRepositorySession( null );
 
         assertNotNull( "Local repository", mojo.localRepository );
-        testMavenProject = builder.buildWithDependencies( pluginXmlFile, mojo.localRepository, profileManager );
+        testMavenProject = builder.build( pluginXmlFile, buildingRequest ).getProject();
 
         File outputDir = mojo.getReportOutputDirectory();
         String filename = mojo.getOutputName() + ".html";
diff --git a/src/test/java/org/apache/maven/report/projectinfo/ModulesReportTest.java b/src/test/java/org/apache/maven/report/projectinfo/ModulesReportTest.java
index 7bc8df9..f4577ea 100644
--- a/src/test/java/org/apache/maven/report/projectinfo/ModulesReportTest.java
+++ b/src/test/java/org/apache/maven/report/projectinfo/ModulesReportTest.java
@@ -22,6 +22,7 @@ package org.apache.maven.report.projectinfo;
 import java.io.File;
 import java.lang.reflect.Field;
 import java.net.URL;
+import java.util.Collections;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.report.projectinfo.stubs.SubProject1Stub;
@@ -33,8 +34,6 @@ import com.meterware.httpunit.WebConversation;
 import com.meterware.httpunit.WebRequest;
 import com.meterware.httpunit.WebResponse;
 
-import edu.emory.mathcs.backport.java.util.Collections;
-
 /**
  * @author ltheussl
  * @version $Id$
diff --git a/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoProjectStub.java b/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoProjectStub.java
index 5ee3cb8..5edad2a 100644
--- a/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoProjectStub.java
+++ b/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoProjectStub.java
@@ -23,6 +23,7 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
@@ -86,7 +87,8 @@ public abstract class ProjectInfoProjectStub
         setUrl( model.getUrl() );
         setPackaging( model.getPackaging() );
 
-        Artifact artifact = new ProjectInfoPluginArtifactStub( getGroupId(), getArtifactId(), getVersion(), getPackaging() );
+        String type = Objects.toString( super.getPackaging(), "jar" );
+        Artifact artifact = new ProjectInfoPluginArtifactStub( getGroupId(), getArtifactId(), getVersion(), type );
         artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
         setArtifact( artifact );
 
@@ -186,5 +188,4 @@ public abstract class ProjectInfoProjectStub
 
         return pluginMgmt;
     }
-
 }

-- 
To stop receiving notification emails like this one, please contact
rfscholte@apache.org.

Mime
View raw message