You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2018/10/16 02:54:21 UTC

[maven-surefire] branch 3.0.0-M1 updated (dc1e390 -> ce1d41f)

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a change to branch 3.0.0-M1
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git.


 discard dc1e390  [SUREFIRE-1493] Maven Plugin API 3.0
     new ce1d41f  [SUREFIRE-1493] Maven Plugin API 3.0

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (dc1e390)
            \
             N -- N -- N   refs/heads/3.0.0-M1 (ce1d41f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 maven-failsafe-plugin/pom.xml                      |  2 +-
 maven-surefire-common/pom.xml                      | 60 +-------------
 .../plugin/surefire/AbstractSurefireMojo.java      | 18 -----
 maven-surefire-plugin/pom.xml                      |  2 +-
 maven-surefire-report-plugin/pom.xml               | 91 +++++++---------------
 pom.xml                                            | 15 +---
 surefire-grouper/pom.xml                           |  2 +-
 .../src/test/resources/SurefireToolchains/pom.xml  |  2 +-
 surefire-providers/common-junit48/pom.xml          | 26 -------
 surefire-report-parser/pom.xml                     |  2 +-
 10 files changed, 41 insertions(+), 179 deletions(-)


[maven-surefire] 01/01: [SUREFIRE-1493] Maven Plugin API 3.0

Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch 3.0.0-M1
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit ce1d41ff907ad4b6cc674533956243926875ef11
Author: Tibor17 <ti...@apache.org>
AuthorDate: Fri Oct 12 01:35:27 2018 +0200

    [SUREFIRE-1493] Maven Plugin API 3.0
---
 maven-failsafe-plugin/pom.xml                      |  17 +--
 .../apache/maven/plugin/failsafe/VerifyMojo.java   |   2 +-
 maven-surefire-common/pom.xml                      |  53 +------
 .../plugin/surefire/AbstractSurefireMojo.java      | 161 ++++-----------------
 .../apache/maven/plugin/surefire/ProviderInfo.java |   4 +-
 .../surefire/SurefireDependencyResolver.java       |  78 +++++-----
 .../maven/plugin/surefire/SurefireHelper.java      |  18 +--
 maven-surefire-plugin/pom.xml                      |   6 +-
 maven-surefire-report-plugin/pom.xml               |  64 +++++---
 pom.xml                                            |  26 ++--
 surefire-grouper/pom.xml                           |   2 +-
 .../src/test/resources/SurefireToolchains/pom.xml  |   2 +-
 surefire-providers/common-junit48/pom.xml          |  26 ----
 surefire-report-parser/pom.xml                     |   2 +-
 14 files changed, 145 insertions(+), 316 deletions(-)

diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
index 19de66f..8e7d2c9 100644
--- a/maven-failsafe-plugin/pom.xml
+++ b/maven-failsafe-plugin/pom.xml
@@ -35,7 +35,7 @@
   <description>Maven Failsafe MOJO in maven-failsafe-plugin.</description>
 
   <prerequisites>
-    <maven>2.2.1</maven>
+    <maven>3.0</maven>
   </prerequisites>
 
   <properties>
@@ -75,6 +75,10 @@
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-artifact-transfer</artifactId>
+    </dependency>
   </dependencies>
 
   <build>
@@ -170,7 +174,8 @@
             </goals>
             <configuration>
               <target name="generate-failsafe-test-report">
-                <move file="${project.build.directory}/source-site/resources/xsd/surefire-test-report.xsd" tofile="${project.build.directory}/source-site/resources/xsd/failsafe-test-report.xsd" />
+                <move file="${project.build.directory}/source-site/resources/xsd/surefire-test-report.xsd"
+                      tofile="${project.build.directory}/source-site/resources/xsd/failsafe-test-report.xsd"/>
               </target>
             </configuration>
           </execution>
@@ -257,15 +262,7 @@
       </build>
     </profile>
     <profile>
-      <!-- run integration tests
-          to use this profile:
-          or run integration tests: mvn -Prun-its
-      -->
       <id>run-its</id>
-      <properties>
-        <!-- skip tests with -DskipTests -->
-        <skipTests>false</skipTests>
-      </properties>
       <build>
         <defaultGoal>verify</defaultGoal>
         <plugins>
diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
index bbf47eb..dbb6b7e 100644
--- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
+++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
@@ -151,7 +151,7 @@ public class VerifyMojo
     /**
      * The current build session instance.
      */
-    @Component
+    @Parameter( defaultValue = "${session}", readonly = true )
     private MavenSession session;
 
     @Component
diff --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
index 163b830..ea3db2c 100644
--- a/maven-surefire-common/pom.xml
+++ b/maven-surefire-common/pom.xml
@@ -33,7 +33,7 @@
   <description>API used in Surefire and Failsafe MOJO.</description>
 
   <prerequisites>
-    <maven>2.2.1</maven>
+    <maven>3.0</maven>
   </prerequisites>
 
   <dependencies>
@@ -62,14 +62,6 @@
       <artifactId>maven-artifact</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-descriptor</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
-    </dependency>
-    <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>
@@ -97,6 +89,12 @@
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-common-artifact-filters</artifactId>
+      <exclusions>
+        <exclusion>
+           <groupId>org.apache.maven.shared</groupId>
+           <artifactId>maven-plugin-testing-harness</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.fusesource.jansi</groupId>
@@ -142,43 +140,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>add-source</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>add-source</goal>
-            </goals>
-            <configuration>
-              <sources>
-                <source>${project.build.directory}/generated-sources</source>
-              </sources>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <!-- Remove in 3.0 -->
-        <artifactId>maven-dependency-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>shared-logging-generated-sources</id>
-            <phase>generate-sources</phase>
-            <goals>
-              <goal>unpack</goal>
-            </goals>
-            <configuration>
-              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
-              <overWriteIfNewer>false</overWriteIfNewer>
-              <artifact>org.apache.maven.shared:maven-shared-utils:3.1.0:jar:sources</artifact>
-              <includes>org/apache/maven/shared/utils/logging/*.java</includes>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <includes>
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index c976a23..b8f759a 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -22,15 +22,11 @@ package org.apache.maven.plugin.surefire;
 
 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.ArtifactRepository;
-import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.repository.RepositorySystem;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
 import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
@@ -53,7 +49,6 @@ import org.apache.maven.plugin.surefire.log.PluginConsoleLogger;
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
 import org.apache.maven.plugin.surefire.util.DependencyScanner;
 import org.apache.maven.plugin.surefire.util.DirectoryScanner;
-import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
@@ -95,7 +90,6 @@ import javax.annotation.Nonnull;
 import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Array;
-import java.lang.reflect.Method;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -199,7 +193,7 @@ public abstract class AbstractSurefireMojo
     /**
      * The Maven Project Object.
      */
-    @Component
+    @Parameter( defaultValue = "${project}", required = true, readonly = true )
     private MavenProject project;
 
     /**
@@ -330,14 +324,12 @@ public abstract class AbstractSurefireMojo
     /**
      * Map of plugin artifacts.
      */
-    // olamy: would make more sense using defaultValue but doesn't work with maven 2.x
     @Parameter( property = "plugin.artifactMap", required = true, readonly = true )
     private Map<String, Artifact> pluginArtifactMap;
 
     /**
      * Map of project artifacts.
      */
-    // olamy: would make more sense using defaultValue but doesn't work with maven 2.x
     @Parameter( property = "project.artifactMap", readonly = true, required = true )
     private Map<String, Artifact> projectArtifactMap;
 
@@ -667,12 +659,6 @@ public abstract class AbstractSurefireMojo
     private boolean trimStackTrace;
 
     /**
-     * Resolves the artifacts needed.
-     */
-    @Component
-    private ArtifactResolver artifactResolver;
-
-    /**
      * Creates the artifact.
      */
     @Component
@@ -687,12 +673,6 @@ public abstract class AbstractSurefireMojo
     private List<ArtifactRepository> remoteRepositories;
 
     /**
-     * For retrieval of artifact's metadata.
-     */
-    @Component
-    private ArtifactMetadataSource metadataSource;
-
-    /**
      * Flag to disable the generation of report files in xml format.
      *
      * @since 2.2
@@ -712,7 +692,7 @@ public abstract class AbstractSurefireMojo
     /**
      * The current build session instance.
      */
-    @Component
+    @Parameter( defaultValue = "${session}", required = true, readonly = true )
     private MavenSession session;
 
     @Component
@@ -727,7 +707,7 @@ public abstract class AbstractSurefireMojo
     private String objectFactory;
 
     /**
-     *
+     * Parallel Maven Execution.
      */
     @Parameter( defaultValue = "${session.parallel}", readonly = true )
     private Boolean parallelMavenExecution;
@@ -754,9 +734,6 @@ public abstract class AbstractSurefireMojo
     @Parameter( property = "dependenciesToScan" )
     private String[] dependenciesToScan;
 
-    /**
-     *
-     */
     @Component
     private ToolchainManager toolchainManager;
 
@@ -765,6 +742,9 @@ public abstract class AbstractSurefireMojo
     // @Component
     // private LocationManager locationManager;
 
+    @Component
+    private RepositorySystem repositorySystem;
+
     private Artifact surefireBooterArtifact;
 
     private Toolchain toolchain;
@@ -1043,9 +1023,9 @@ public abstract class AbstractSurefireMojo
 
     private void createDependencyResolver()
     {
-        dependencyResolver = new SurefireDependencyResolver( getArtifactResolver(), getArtifactFactory(),
+        dependencyResolver = new SurefireDependencyResolver( getRepositorySystem(), getArtifactFactory(),
                                                                    getConsoleLogger(), getLocalRepository(),
-                                                                   getRemoteRepositories(), getMetadataSource(),
+                                                                   getRemoteRepositories(),
                                                                    getPluginName() );
     }
 
@@ -1182,6 +1162,7 @@ public abstract class AbstractSurefireMojo
 
                 return forkStarter.run( effectiveProperties, scanResult );
             }
+            // tod Java 1.7 multiple exception catch block
             catch ( SurefireExecutionException e )
             {
                 forkStarter.killOrphanForks();
@@ -1238,6 +1219,16 @@ public abstract class AbstractSurefireMojo
             capitalizeFirstLetter( getPluginName() ) + " report directory: " + getReportsDirectory() );
     }
 
+    public RepositorySystem getRepositorySystem()
+    {
+        return repositorySystem;
+    }
+
+    public void setRepositorySystem( RepositorySystem repositorySystem )
+    {
+        this.repositorySystem = repositorySystem;
+    }
+
     final Toolchain getToolchain()
     {
         Toolchain tc = null;
@@ -1730,10 +1721,6 @@ public abstract class AbstractSurefireMojo
                 return newStartupConfigWithClasspath( classLoaderConfiguration, providerArtifacts, providerName );
             }
         }
-        catch ( AbstractArtifactResolutionException e )
-        {
-            throw new MojoExecutionException( "Unable to generate classpath: " + e, e );
-        }
         catch ( IOException e )
         {
             throw new MojoExecutionException( e.getMessage(), e );
@@ -2155,7 +2142,6 @@ public abstract class AbstractSurefireMojo
 
         Artifact shadeFire = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-shadefire" );
 
-        // todo: 150 milli seconds, try to fetch List<String> within classpath asynchronously
         Classpath bootClasspath = getArtifactClasspath( shadeFire != null ? shadeFire : surefireBooterArtifact );
 
         Platform platform = PLATFORM.withJdkExecAttributesForTests( getEffectiveJvm() );
@@ -2522,32 +2508,9 @@ public abstract class AbstractSurefireMojo
         }
     }
 
-
-    private ArtifactResolutionResult resolveArtifact( Artifact filteredArtifact, Artifact providerArtifact )
+    private ArtifactResolutionResult resolveArtifact( Artifact providerArtifact )
     {
-        ArtifactFilter filter = null;
-        if ( filteredArtifact != null )
-        {
-            filter = new ExcludesArtifactFilter(
-                Collections.singletonList( filteredArtifact.getGroupId() + ":" + filteredArtifact.getArtifactId() ) );
-        }
-
-        Artifact originatingArtifact = getArtifactFactory().createBuildArtifact( "dummy", "dummy", "1.0", "jar" );
-
-        try
-        {
-            return getArtifactResolver().resolveTransitively( Collections.singleton( providerArtifact ),
-                                                              originatingArtifact, getLocalRepository(),
-                                                              getRemoteRepositories(), getMetadataSource(), filter );
-        }
-        catch ( ArtifactResolutionException e )
-        {
-            throw new RuntimeException( e );
-        }
-        catch ( ArtifactNotFoundException e )
-        {
-            throw new RuntimeException( e );
-        }
+        return dependencyResolver.resolveArtifact( providerArtifact );
     }
 
     private Classpath getArtifactClasspath( Artifact surefireArtifact )
@@ -2555,17 +2518,12 @@ public abstract class AbstractSurefireMojo
         Classpath existing = ClasspathCache.getCachedClassPath( surefireArtifact.getArtifactId() );
         if ( existing == null )
         {
-            ArtifactResolutionResult result = resolveArtifact( null, surefireArtifact );
-
             List<String> items = new ArrayList<String>();
-            for ( Object o : result.getArtifacts() )
+            for ( Artifact artifact : resolveArtifact( surefireArtifact ).getArtifacts() )
             {
-                Artifact artifact = (Artifact) o;
-
                 getConsoleLogger().debug(
                     "Adding to " + getPluginName() + " booter test classpath: " + artifact.getFile().getAbsolutePath()
                     + " Scope: " + artifact.getScope() );
-
                 items.add( artifact.getFile().getAbsolutePath() );
             }
             existing = new Classpath( items );
@@ -2576,34 +2534,9 @@ public abstract class AbstractSurefireMojo
 
     private Properties getUserProperties()
     {
-        Properties props = null;
-        try
-        {
-            // try calling MavenSession.getUserProperties() from Maven 2.1.0-M1+
-            Method getUserProperties = getSession().getClass().getMethod( "getUserProperties" );
-            props = (Properties) getUserProperties.invoke( getSession() );
-        }
-        catch ( Exception e )
-        {
-            String msg = "Build uses Maven 2.0.x, cannot propagate system properties"
-                + " from command line to tests (cf. SUREFIRE-121)";
-            if ( getConsoleLogger().isDebugEnabled() )
-            {
-                getConsoleLogger().debug( msg, e );
-            }
-            else
-            {
-                getConsoleLogger().warning( msg );
-            }
-        }
-        if ( props == null )
-        {
-            props = new Properties();
-        }
-        return props;
+        return getSession().getUserProperties();
     }
 
-
     private void ensureWorkingDirectoryExists()
         throws MojoFailureException
     {
@@ -2811,11 +2744,10 @@ public abstract class AbstractSurefireMojo
         @Override
         @Nonnull
         public Set<Artifact> getProviderClasspath()
-            throws ArtifactResolutionException, ArtifactNotFoundException
         {
             Artifact surefireArtifact = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-booter" );
             String version = surefireArtifact.getBaseVersion();
-            return dependencyResolver.getProviderClasspath( "surefire-testng", version, testNgArtifact );
+            return dependencyResolver.getProviderClasspath( "surefire-testng", version );
         }
     }
 
@@ -2842,12 +2774,11 @@ public abstract class AbstractSurefireMojo
         @Override
         @Nonnull
         public Set<Artifact> getProviderClasspath()
-            throws ArtifactResolutionException, ArtifactNotFoundException
         {
             // add the JUnit provider as default - it doesn't require JUnit to be present,
             // since it supports POJO tests.
             String version = surefireBooterArtifact.getBaseVersion();
-            return dependencyResolver.getProviderClasspath( "surefire-junit3", version, null );
+            return dependencyResolver.getProviderClasspath( "surefire-junit3", version );
         }
     }
 
@@ -2884,10 +2815,9 @@ public abstract class AbstractSurefireMojo
         @Override
         @Nonnull
         public Set<Artifact> getProviderClasspath()
-            throws ArtifactResolutionException, ArtifactNotFoundException
         {
             String version = surefireBooterArtifact.getBaseVersion();
-            return dependencyResolver.getProviderClasspath( "surefire-junit4", version, null );
+            return dependencyResolver.getProviderClasspath( "surefire-junit4", version );
         }
     }
 
@@ -2923,10 +2853,9 @@ public abstract class AbstractSurefireMojo
         @Override
         @Nonnull
         public Set<Artifact> getProviderClasspath()
-            throws ArtifactResolutionException, ArtifactNotFoundException
         {
             String version = surefireBooterArtifact.getBaseVersion();
-            return dependencyResolver.getProviderClasspath( "surefire-junit-platform", version, null );
+            return dependencyResolver.getProviderClasspath( "surefire-junit-platform", version );
         }
     }
 
@@ -2972,10 +2901,9 @@ public abstract class AbstractSurefireMojo
         @Override
         @Nonnull
         public Set<Artifact> getProviderClasspath()
-            throws ArtifactResolutionException, ArtifactNotFoundException
         {
             String version = surefireBooterArtifact.getBaseVersion();
-            return dependencyResolver.getProviderClasspath( "surefire-junit47", version, null );
+            return dependencyResolver.getProviderClasspath( "surefire-junit47", version );
         }
     }
 
@@ -3022,7 +2950,6 @@ public abstract class AbstractSurefireMojo
         @Override
         @Nonnull
         public Set<Artifact> getProviderClasspath()
-            throws ArtifactResolutionException, ArtifactNotFoundException
         {
             return dependencyResolver.addProviderToClasspath( pluginArtifactMap, getMojoArtifact() );
         }
@@ -3504,17 +3431,6 @@ public abstract class AbstractSurefireMojo
         this.trimStackTrace = trimStackTrace;
     }
 
-    public ArtifactResolver getArtifactResolver()
-    {
-        return artifactResolver;
-    }
-
-    @SuppressWarnings( "UnusedDeclaration" )
-    public void setArtifactResolver( ArtifactResolver artifactResolver )
-    {
-        this.artifactResolver = artifactResolver;
-    }
-
     public ArtifactFactory getArtifactFactory()
     {
         return artifactFactory;
@@ -3537,18 +3453,6 @@ public abstract class AbstractSurefireMojo
         this.remoteRepositories = remoteRepositories;
     }
 
-    public ArtifactMetadataSource getMetadataSource()
-    {
-        return metadataSource;
-    }
-
-    @SuppressWarnings( "UnusedDeclaration" )
-    public void setMetadataSource( ArtifactMetadataSource metadataSource )
-    {
-        this.metadataSource = metadataSource;
-    }
-
-
     public boolean isDisableXmlReport()
     {
         return disableXmlReport;
@@ -3633,11 +3537,6 @@ public abstract class AbstractSurefireMojo
         this.dependenciesToScan = dependenciesToScan;
     }
 
-    public PluginDescriptor getPluginDescriptor()
-    {
-        return pluginDescriptor;
-    }
-
     public MavenProject getProject()
     {
         return project;
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.java
index e99cc82..cb63cc1 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ProviderInfo.java
@@ -20,7 +20,6 @@ package org.apache.maven.plugin.surefire;
  */
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException;
 import org.apache.maven.plugin.MojoExecutionException;
 
 import javax.annotation.Nonnull;
@@ -37,8 +36,7 @@ public interface ProviderInfo
     boolean isApplicable();
 
     @Nonnull
-    Set<Artifact> getProviderClasspath()
-        throws AbstractArtifactResolutionException;
+    Set<Artifact> getProviderClasspath();
 
     void addProviderProperties() throws MojoExecutionException;
 }
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
index f33a316..fa3932c 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
@@ -19,31 +19,28 @@ package org.apache.maven.plugin.surefire;
  * under the License.
  */
 
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 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.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
 import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
+import org.apache.maven.repository.RepositorySystem;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
-import java.util.Collections;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
-import static java.util.Collections.singleton;
+import static java.util.Collections.singletonList;
 import static org.apache.maven.artifact.Artifact.SCOPE_TEST;
 import static org.apache.maven.artifact.versioning.VersionRange.createFromVersion;
 
@@ -53,10 +50,9 @@ import static org.apache.maven.artifact.versioning.VersionRange.createFromVersio
  * @author Stephen Connolly
  * @author Kristian Rosenvold
  */
-public class SurefireDependencyResolver
+final class SurefireDependencyResolver
 {
-
-    private final ArtifactResolver artifactResolver;
+    private final RepositorySystem repositorySystem;
 
     private final ArtifactFactory artifactFactory;
 
@@ -66,27 +62,21 @@ public class SurefireDependencyResolver
 
     private final List<ArtifactRepository> remoteRepositories;
 
-    private final ArtifactMetadataSource artifactMetadataSource;
-
     private final String pluginName;
 
-    protected SurefireDependencyResolver( ArtifactResolver artifactResolver, ArtifactFactory artifactFactory,
-                                          ConsoleLogger log,
+    SurefireDependencyResolver( RepositorySystem repositorySystem, ArtifactFactory artifactFactory, ConsoleLogger log,
                                           ArtifactRepository localRepository,
-                                          List<ArtifactRepository> remoteRepositories,
-                                          ArtifactMetadataSource artifactMetadataSource, String pluginName )
+                                          List<ArtifactRepository> remoteRepositories, String pluginName )
     {
-        this.artifactResolver = artifactResolver;
+        this.repositorySystem = repositorySystem;
         this.artifactFactory = artifactFactory;
         this.log = log;
         this.localRepository = localRepository;
         this.remoteRepositories = remoteRepositories;
-        this.artifactMetadataSource = artifactMetadataSource;
         this.pluginName = pluginName;
     }
 
-
-    public boolean isWithinVersionSpec( @Nullable Artifact artifact, @Nonnull String versionSpec )
+    boolean isWithinVersionSpec( @Nullable Artifact artifact, @Nonnull String versionSpec )
     {
         if ( artifact == null )
         {
@@ -114,39 +104,38 @@ public class SurefireDependencyResolver
         }
     }
 
+    ArtifactResolutionResult resolveArtifact( Artifact providerArtifact )
+    {
+        return resolveArtifact( providerArtifact, null );
+    }
 
-    private ArtifactResolutionResult resolveArtifact( Artifact filteredArtifact, Artifact providerArtifact )
-        throws ArtifactResolutionException, ArtifactNotFoundException
+    private ArtifactResolutionResult resolveArtifact( Artifact providerArtifact, @Nullable Artifact excludeArtifact )
     {
-        ArtifactFilter filter = null;
-        if ( filteredArtifact != null )
+        ArtifactResolutionRequest request = new ArtifactResolutionRequest()
+                                                    .setArtifact( providerArtifact )
+                                                    .setRemoteRepositories( remoteRepositories )
+                                                    .setLocalRepository( localRepository )
+                                                    .setResolveTransitively( true );
+        if ( excludeArtifact != null )
         {
-            filter = new ExcludesArtifactFilter(
-                Collections.singletonList( filteredArtifact.getGroupId() + ":" + filteredArtifact.getArtifactId() ) );
+            String pattern = excludeArtifact.getGroupId() + ":" + excludeArtifact.getArtifactId();
+            request.setCollectionFilter( new ExcludesArtifactFilter( singletonList( pattern ) ) );
         }
-
-        Artifact originatingArtifact = artifactFactory.createBuildArtifact( "dummy", "dummy", "1.0", "jar" );
-
-        return artifactResolver.resolveTransitively( singleton( providerArtifact ), originatingArtifact,
-                                                     localRepository, remoteRepositories, artifactMetadataSource,
-                                                     filter );
+        return repositorySystem.resolve( request );
     }
 
     @Nonnull
-    @SuppressWarnings( "unchecked" )
-    public Set<Artifact> getProviderClasspath( String provider, String version, Artifact filteredArtifact )
-        throws ArtifactNotFoundException, ArtifactResolutionException
+    Set<Artifact> getProviderClasspath( String provider, String version )
     {
         Artifact providerArtifact = artifactFactory.createDependencyArtifact( "org.apache.maven.surefire",
                 provider, createFromVersion( version ), "jar", null, SCOPE_TEST );
 
-        ArtifactResolutionResult result = resolveArtifact( filteredArtifact, providerArtifact );
+        ArtifactResolutionResult result = resolveArtifact( providerArtifact );
 
         if ( log.isDebugEnabled() )
         {
-            for ( Object o : result.getArtifacts() )
+            for ( Artifact artifact : result.getArtifacts() )
             {
-                Artifact artifact = (Artifact) o;
                 String artifactPath = artifact.getFile().getAbsolutePath();
                 String scope = artifact.getScope();
                 log.debug( "Adding to " + pluginName + " test classpath: " + artifactPath + " Scope: " + scope );
@@ -156,13 +145,12 @@ public class SurefireDependencyResolver
         return result.getArtifacts();
     }
 
-    public Set<Artifact> addProviderToClasspath( Map<String, Artifact> pluginArtifactMap, Artifact surefireArtifact )
-        throws ArtifactResolutionException, ArtifactNotFoundException
+    Set<Artifact> addProviderToClasspath( Map<String, Artifact> pluginArtifactMap, Artifact surefireArtifact )
     {
         Set<Artifact> providerArtifacts = new LinkedHashSet<Artifact>();
         if ( surefireArtifact != null )
         {
-            ArtifactResolutionResult artifactResolutionResult = resolveArtifact( null, surefireArtifact );
+            final ArtifactResolutionResult artifactResolutionResult = resolveArtifact( surefireArtifact );
             for ( Artifact artifact : pluginArtifactMap.values() )
             {
                 if ( !artifactResolutionResult.getArtifacts().contains( artifact ) )
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
index 44dbdd4..29bc8d9 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
@@ -31,7 +31,6 @@ import org.apache.maven.surefire.util.internal.DumpFileUtils;
 
 import javax.annotation.Nonnull;
 import java.io.File;
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -195,7 +194,7 @@ public final class SurefireHelper
                 cli.add( SHOW_ERRORS );
             }
 
-            String f = getFailureBehavior( request );
+            String f = request.getReactorFailureBehavior();
             if ( f != null )
             {
                 // compatible with enums Maven 3.0
@@ -250,21 +249,6 @@ public final class SurefireHelper
         return path;
     }
 
-    private static String getFailureBehavior( MavenExecutionRequest request )
-        throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
-    {
-        try
-        {
-            return request.getFailureBehavior();
-        }
-        catch ( NoSuchMethodError e )
-        {
-            return (String) request.getClass()
-                .getMethod( "getReactorFailureBehavior" )
-                .invoke( request );
-        }
-    }
-
     private static boolean failIfNoTests( SurefireReportParameters reportParameters )
     {
         return reportParameters.getFailIfNoTests() != null && reportParameters.getFailIfNoTests();
diff --git a/maven-surefire-plugin/pom.xml b/maven-surefire-plugin/pom.xml
index 9ac4d00..b0f9151 100644
--- a/maven-surefire-plugin/pom.xml
+++ b/maven-surefire-plugin/pom.xml
@@ -35,7 +35,7 @@
   <description>Maven Surefire MOJO in maven-surefire-plugin.</description>
 
   <prerequisites>
-    <maven>2.2.1</maven>
+    <maven>3.0</maven>
   </prerequisites>
 
   <properties>
@@ -48,6 +48,10 @@
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>maven-surefire-common</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-artifact-transfer</artifactId>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/maven-surefire-report-plugin/pom.xml b/maven-surefire-report-plugin/pom.xml
index 9e04880..18568d5 100644
--- a/maven-surefire-report-plugin/pom.xml
+++ b/maven-surefire-report-plugin/pom.xml
@@ -49,7 +49,7 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
+      <artifactId>maven-core</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -78,6 +78,12 @@
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-impl</artifactId>
       <version>2.4</version>
+      <exclusions>
+      	<exclusion>
+      		<artifactId>maven-project</artifactId>
+      		<groupId>org.apache.maven</groupId>
+      	</exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
@@ -86,7 +92,7 @@
     </dependency>
     <dependency>
       <!-- using the same transient version 3.0.15 from doxia-site-renderer:1.6 which is in conflict
-      with version 1.5.15 in maven-project:2.2.1 on the same level of dependency tree -->
+      with version 1.5.15 in maven-project:3.0 on the same level of dependency tree -->
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
       <version>3.0.15</version>
@@ -94,13 +100,21 @@
     <dependency>
       <groupId>org.fusesource.jansi</groupId>
       <artifactId>jansi</artifactId>
-      <version>1.13</version>
       <scope>provided</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-shared-utils</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.maven.plugin-testing</groupId>
       <artifactId>maven-plugin-testing-harness</artifactId>
-      <version>1.2</version>
+      <version>2.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-compat</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -154,32 +168,40 @@
         </executions>
       </plugin>
       <plugin>
-        <artifactId>maven-dependency-plugin</artifactId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <useSystemClassLoader>true</useSystemClassLoader>
+          <classpathDependencyExcludes>
+            <classpathDependencyExclude>org.fusesource.jansi:jansi</classpathDependencyExclude>
+          </classpathDependencyExcludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
         <executions>
           <execution>
-            <id>shared-logging-generated-sources</id>
-            <phase>generate-sources</phase>
+            <phase>package</phase>
             <goals>
-              <goal>unpack</goal>
+              <goal>shade</goal>
             </goals>
             <configuration>
-              <outputDirectory>${project.build.directory}/generated-sources/dependency</outputDirectory>
-              <overWriteIfNewer>false</overWriteIfNewer>
-              <artifact>org.apache.maven.shared:maven-shared-utils:3.1.0:jar:sources</artifact>
-              <includes>org/apache/maven/shared/utils/logging/*.java</includes>
+              <minimizeJar>true</minimizeJar>
+              <artifactSet>
+                <includes>
+                  <include>org.apache.maven.shared:maven-shared-utils</include>
+                </includes>
+              </artifactSet>
+              <relocations>
+                <relocation>
+                  <pattern>org.apache.maven.shared</pattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
+                </relocation>
+              </relocations>
             </configuration>
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <useSystemClassLoader>true</useSystemClassLoader>
-          <classpathDependencyExcludes>
-            <classpathDependencyExclude>org.fusesource.jansi:jansi</classpathDependencyExclude>
-          </classpathDependencyExcludes>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 
diff --git a/pom.xml b/pom.xml
index 99c9746..f34d771 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,11 +84,12 @@
   </distributionManagement>
 
   <properties>
-    <mavenVersion>2.2.1</mavenVersion>
+    <javaVersion>7</javaVersion>
+    <mavenVersion>3.0</mavenVersion>
     <!-- <shadedVersion>2.12.4</shadedVersion> commented out due to https://issues.apache.org/jira/browse/MRELEASE-799 -->
     <commonsLang3Version>3.5</commonsLang3Version>
     <commonsIoVersion>2.5</commonsIoVersion>
-    <mavenSharedUtilsVersion>0.9</mavenSharedUtilsVersion>
+    <mavenSharedUtilsVersion>3.1.0</mavenSharedUtilsVersion>
     <powermockVersion>2.0.0-beta.5</powermockVersion>
     <maven.surefire.scm.devConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>
     <maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>
@@ -139,13 +140,13 @@
       <dependency>
         <groupId>org.apache.maven.reporting</groupId>
         <artifactId>maven-reporting-api</artifactId>
-        <version>3.0</version>
+        <version>${mavenVersion}</version>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-core</artifactId>
         <version>${mavenVersion}</version>
-        <exclusions>
+        <!--<exclusions>
           <exclusion>
             <groupId>org.apache.maven.wagon</groupId>
             <artifactId>wagon-file</artifactId>
@@ -178,7 +179,7 @@
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-interactivity-api</artifactId>
           </exclusion>
-        </exclusions>
+        </exclusions>-->
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
@@ -198,23 +199,24 @@
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
-        <artifactId>maven-plugin-descriptor</artifactId>
+        <artifactId>maven-model</artifactId>
         <version>${mavenVersion}</version>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
-        <artifactId>maven-project</artifactId>
+        <artifactId>maven-compat</artifactId>
         <version>${mavenVersion}</version>
+        <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
-        <artifactId>maven-model</artifactId>
-        <version>${mavenVersion}</version>
+        <artifactId>maven-toolchain</artifactId>
+        <version>3.0-alpha-2</version>
       </dependency>
       <dependency>
-        <groupId>org.apache.maven</groupId>
-        <artifactId>maven-toolchain</artifactId>
-        <version>${mavenVersion}</version>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-artifact-transfer</artifactId>
+        <version>0.10.0</version>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
diff --git a/surefire-grouper/pom.xml b/surefire-grouper/pom.xml
index 69079d5..e722892 100644
--- a/surefire-grouper/pom.xml
+++ b/surefire-grouper/pom.xml
@@ -33,7 +33,7 @@
   <description>Maven Surefire Test-Grouping Support</description>
 
   <prerequisites>
-    <maven>2.2.1</maven>
+    <maven>3.0</maven>
   </prerequisites>
 
   <build>
diff --git a/surefire-its/src/test/resources/SurefireToolchains/pom.xml b/surefire-its/src/test/resources/SurefireToolchains/pom.xml
index 2d066eb..2a1df26 100644
--- a/surefire-its/src/test/resources/SurefireToolchains/pom.xml
+++ b/surefire-its/src/test/resources/SurefireToolchains/pom.xml
@@ -15,7 +15,7 @@
     </properties>
 
     <prerequisites>
-        <maven>2.2.1</maven>
+        <maven>3.0</maven>
     </prerequisites>
     
     <dependencies>
diff --git a/surefire-providers/common-junit48/pom.xml b/surefire-providers/common-junit48/pom.xml
index 38e7e41..e2e4407 100644
--- a/surefire-providers/common-junit48/pom.xml
+++ b/surefire-providers/common-junit48/pom.xml
@@ -58,32 +58,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-shade-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-            <configuration>
-              <minimizeJar>true</minimizeJar>
-              <artifactSet>
-                <includes>
-                  <include>org.codehaus.plexus:plexus-utils</include>
-                </includes>
-              </artifactSet>
-              <relocations>
-                <relocation>
-                  <pattern>org.codehaus.plexus.util</pattern>
-                  <shadedPattern>org.apache.maven.surefire.commonjunit48.org.codehaus.plexus.util</shadedPattern>
-                </relocation>
-              </relocations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <includes>
diff --git a/surefire-report-parser/pom.xml b/surefire-report-parser/pom.xml
index 944dad0..4793afa 100644
--- a/surefire-report-parser/pom.xml
+++ b/surefire-report-parser/pom.xml
@@ -33,7 +33,7 @@
   <description>Parses report output files from surefire.</description>
 
   <prerequisites>
-    <maven>2.2.1</maven>
+    <maven>3.0</maven>
   </prerequisites>
 
   <dependencies>