maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tibordig...@apache.org
Subject [maven-surefire] 01/01: [SUREFIRE-1493] Maven Plugin API 3.0
Date Mon, 29 Oct 2018 23:33:48 GMT
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 276ef7438a4df8d95c04154089835950f18155f7
Author: Tibor17 <tibordigana@apache.org>
AuthorDate: Fri Oct 12 01:35:27 2018 +0200

    [SUREFIRE-1493] Maven Plugin API 3.0
---
 README.md                                          |   2 +-
 maven-failsafe-plugin/pom.xml                      |  15 +-
 .../apache/maven/plugin/failsafe/VerifyMojo.java   |   2 +-
 maven-surefire-common/pom.xml                      |  76 +---
 .../plugin/surefire/AbstractSurefireMojo.java      | 207 +++--------
 .../apache/maven/plugin/surefire/ProviderInfo.java |   4 +-
 .../surefire/SurefireDependencyResolver.java       | 154 +++++---
 .../maven/plugin/surefire/SurefireHelper.java      |  44 +--
 .../plugin/surefire/log/PluginConsoleLogger.java   |  43 +--
 .../surefire/report/DefaultReporterFactory.java    |  15 +-
 .../surefire/report/StatelessXmlReporter.java      |  21 +-
 .../plugin/surefire/report/TestSetRunListener.java |   2 +-
 .../plugin/surefire/AbstractSurefireMojoTest.java  |  11 +-
 .../surefire/SurefireDependencyResolverTest.java   | 412 +++++++++++++++++++++
 maven-surefire-plugin/pom.xml                      |   3 +-
 maven-surefire-plugin/src/site/apt/index.apt.vm    |   2 +-
 maven-surefire-report-plugin/pom.xml               |  48 +--
 .../surefire/report/PluginConsoleLogger.java       |  43 +--
 .../surefire/report/SurefireReportGenerator.java   |   2 +-
 .../surefire/report/SurefireReportMojoTest.java    |   5 +-
 pom.xml                                            | 141 ++-----
 surefire-api/pom.xml                               |   4 +-
 surefire-booter/pom.xml                            |   6 +-
 surefire-grouper/pom.xml                           |   2 +-
 .../maven/surefire/its/JUnitPlatformEnginesIT.java |   7 +-
 .../src/test/resources/SurefireToolchains/pom.xml  |   2 +-
 .../resources/test-helper-dump-pid-plugin/pom.xml  |   2 +-
 .../test/java/listeners/MarkAsFailureListener.java |  18 +-
 surefire-providers/common-java5/pom.xml            |  10 +-
 surefire-providers/common-junit4/pom.xml           |   1 -
 .../common/junit4/JUnit4RunListenerFactory.java    |   7 +-
 surefire-providers/common-junit48/pom.xml          |  38 +-
 surefire-providers/pom.xml                         |   1 +
 surefire-providers/surefire-junit-platform/pom.xml |  37 +-
 surefire-providers/surefire-junit3/pom.xml         |  31 --
 surefire-providers/surefire-junit4/pom.xml         |  42 ---
 surefire-providers/surefire-junit47/pom.xml        | 292 +++++++--------
 .../surefire-junit47/src/assembly/assembly.xml     |  35 ++
 .../junitcore/ClassesParallelRunListener.java      |   1 +
 .../junitcore/MethodsParallelRunListener.java      |   1 +
 .../maven/surefire/junitcore/ThreadSafe.java       |  37 --
 surefire-providers/surefire-testng-utils/pom.xml   |  31 +-
 surefire-providers/surefire-testng/pom.xml         |   6 -
 surefire-report-parser/pom.xml                     |   7 +-
 surefire-shadefire/pom.xml                         |   3 -
 45 files changed, 941 insertions(+), 932 deletions(-)

diff --git a/README.md b/README.md
index 55736a9..0f160f8 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ Usage of [maven-surefire-plugin], [maven-failsafe-plugin], [maven-surefire-repor
 
 # Build Status
 
-[![dependencies](https://www.versioneye.com/java/org.apache.maven.plugins:maven-surefire-plugin/badge.svg?style=plastic)](https://builds.apache.org/job/maven-wip/job/maven-surefire/depgraph-view/) Maven 2.2.1 Plugin API
+[![dependencies](https://www.versioneye.com/java/org.apache.maven.plugins:maven-surefire-plugin/badge.svg?style=plastic)](https://builds.apache.org/job/maven-wip/job/maven-surefire/depgraph-view/) Maven 3.0 Plugin API
 
 [![license](http://img.shields.io/:license-apache-red.svg?style=plastic)](http://www.apache.org/licenses/LICENSE-2.0.html) [![tests](https://img.shields.io/jenkins/t/https/builds.apache.org/job/maven-box/job/maven-surefire/job/master.svg?style=plastic)](https://builds.apache.org/job/maven-box/job/maven-surefire/job/master/lastBuild/testReport/) [![Build Status](https://builds.apache.org/job/maven-box/job/maven-surefire/job/master/badge/icon?style=plastic)](https://builds.apache.org/job/m [...]
 
diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
index 19de66f..ae4a3d2 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>
@@ -49,6 +49,7 @@
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>maven-surefire-common</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.plugins</groupId>
@@ -170,7 +171,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>
@@ -184,7 +186,6 @@
         </configuration>
       </plugin>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
         <executions>
           <execution>
@@ -257,15 +258,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..6314272 100644
--- a/maven-surefire-common/pom.xml
+++ b/maven-surefire-common/pom.xml
@@ -33,41 +33,35 @@
   <description>API used in Surefire and Failsafe MOJO.</description>
 
   <prerequisites>
-    <maven>2.2.1</maven>
+    <maven>3.0</maven>
   </prerequisites>
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.plugin-tools</groupId>
-      <artifactId>maven-plugin-annotations</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-api</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-booter</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-shared-utils</artifactId>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact</artifactId>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-descriptor</artifactId>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-shared-utils</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
+      <artifactId>maven-artifact</artifactId>
     </dependency>
     <dependency>
       <groupId>commons-io</groupId>
@@ -97,6 +91,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 +142,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>
@@ -194,7 +157,6 @@
         </dependencies>
       </plugin>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
         <executions>
           <execution>
@@ -215,15 +177,15 @@
               <relocations>
                 <relocation>
                   <pattern>org.apache.maven.shared</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.common.org.apache.maven.shared</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.apache.commons.io</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.commons.io</shadedPattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.common.org.apache.commons.io</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.apache.commons.lang3</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.commons.lang3</shadedPattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.common.org.apache.commons.lang3</shadedPattern>
                 </relocation>
               </relocations>
             </configuration>
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..7bdde2a 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,10 @@ 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 +48,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 +89,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;
@@ -119,6 +112,7 @@ import static java.util.Collections.singletonList;
 import static java.util.Collections.singletonMap;
 import static org.apache.commons.lang3.StringUtils.substringBeforeLast;
 import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
+import static org.apache.maven.plugin.surefire.SurefireDependencyResolver.isWithinVersionSpec;
 import static org.apache.maven.plugin.surefire.util.DependencyScanner.filter;
 import static org.apache.maven.plugin.surefire.SurefireHelper.replaceThreadNumberPlaceholders;
 import static org.apache.maven.shared.utils.StringUtils.capitalizeFirstLetter;
@@ -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;
@@ -815,6 +795,11 @@ public abstract class AbstractSurefireMojo
 
     protected abstract String getReportSchemaLocation();
 
+    /**
+     * This plugin MOJO artifact.
+     *
+     * @return non-null plugin artifact
+     */
     protected abstract Artifact getMojoArtifact();
 
     private String getDefaultExcludes()
@@ -1043,14 +1028,14 @@ public abstract class AbstractSurefireMojo
 
     private void createDependencyResolver()
     {
-        dependencyResolver = new SurefireDependencyResolver( getArtifactResolver(), getArtifactFactory(),
+        dependencyResolver = new SurefireDependencyResolver( getRepositorySystem(), getArtifactFactory(),
                                                                    getConsoleLogger(), getLocalRepository(),
-                                                                   getRemoteRepositories(), getMetadataSource(),
+                                                                   getRemoteRepositories(),
                                                                    getPluginName() );
     }
 
     protected List<ProviderInfo> createProviders()
-        throws MojoFailureException, MojoExecutionException
+        throws MojoExecutionException
     {
         Artifact junitDepArtifact = getJunitDepArtifact();
         return new ProviderList( new DynamicProviderInfo( null ),
@@ -1182,6 +1167,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 +1224,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;
@@ -1562,12 +1558,12 @@ public abstract class AbstractSurefireMojo
 
     private boolean isJunit47Compatible( Artifact artifact )
     {
-        return dependencyResolver.isWithinVersionSpec( artifact, "[4.7,)" );
+        return isWithinVersionSpec( artifact, "[4.7,)" );
     }
 
     private boolean isAnyJunit4( Artifact artifact )
     {
-        return dependencyResolver.isWithinVersionSpec( artifact, "[4.0,)" );
+        return isWithinVersionSpec( artifact, "[4.0,)" );
     }
 
     private static boolean isForkModeNever( String forkMode )
@@ -1730,10 +1726,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 );
@@ -1760,7 +1752,7 @@ public abstract class AbstractSurefireMojo
         getConsoleLogger().debug( testClasspath.getCompactLogMessage( "test(compact) classpath:" ) );
         getConsoleLogger().debug( providerClasspath.getCompactLogMessage( "provider(compact) classpath:" ) );
 
-        Artifact[] additionalInProcArtifacts = { getCommonArtifact(), getApiArtifact() };
+        Artifact[] additionalInProcArtifacts = { getCommonArtifact(), getApiArtifact(), getLoggerApiArtifact() };
         Set<Artifact> inProcArtifacts = retainInProcArtifactsUnique( providerArtifacts, additionalInProcArtifacts );
         Classpath inProcClasspath = createInProcClasspath( providerClasspath, inProcArtifacts );
         getConsoleLogger().debug( inProcClasspath.getLogMessage( "in-process classpath:" ) );
@@ -1870,6 +1862,21 @@ public abstract class AbstractSurefireMojo
         return getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-api" );
     }
 
+    private Artifact getLoggerApiArtifact()
+    {
+        return getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-logger-api" );
+    }
+
+    private Artifact getBooterArtifact()
+    {
+        return getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-booter" );
+    }
+
+    private Artifact getShadefireArtifact()
+    {
+        return getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-shadefire" );
+    }
+
     private StartupReportConfiguration getStartupReportConfiguration( String configChecksum, boolean isForkMode )
     {
         return new StartupReportConfiguration( isUseFile(), isPrintSummary(), getReportFormat(),
@@ -2153,9 +2160,8 @@ public abstract class AbstractSurefireMojo
     {
         File tmpDir = getSurefireTempDir();
 
-        Artifact shadeFire = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-shadefire" );
+        Artifact shadeFire = getShadefireArtifact();
 
-        // todo: 150 milli seconds, try to fetch List<String> within classpath asynchronously
         Classpath bootClasspath = getArtifactClasspath( shadeFire != null ? shadeFire : surefireBooterArtifact );
 
         Platform platform = PLATFORM.withJdkExecAttributesForTests( getEffectiveJvm() );
@@ -2337,16 +2343,14 @@ public abstract class AbstractSurefireMojo
 
     private Artifact getSurefireBooterArtifact()
     {
-        Artifact artifact = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-booter" );
+        Artifact artifact = getBooterArtifact();
         if ( artifact == null )
         {
             throw new RuntimeException( "Unable to locate surefire-booter in the list of plugin artifacts" );
         }
-        artifact.isSnapshot(); // MNG-2961: before Maven 2.0.8, fixes getBaseVersion to be -SNAPSHOT if needed
         return artifact;
     }
 
-
     /**
      * Where surefire stores its own temp files
      *
@@ -2522,50 +2526,17 @@ public abstract class AbstractSurefireMojo
         }
     }
 
-
-    private ArtifactResolutionResult resolveArtifact( Artifact filteredArtifact, 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 );
-        }
-    }
-
     private Classpath getArtifactClasspath( Artifact surefireArtifact )
     {
         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 : dependencyResolver.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 +2547,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 +2757,10 @@ public abstract class AbstractSurefireMojo
         @Override
         @Nonnull
         public Set<Artifact> getProviderClasspath()
-            throws ArtifactResolutionException, ArtifactNotFoundException
         {
-            Artifact surefireArtifact = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-booter" );
+            Artifact surefireArtifact = getBooterArtifact();
             String version = surefireArtifact.getBaseVersion();
-            return dependencyResolver.getProviderClasspath( "surefire-testng", version, testNgArtifact );
+            return dependencyResolver.getProviderClasspath( "surefire-testng", version );
         }
     }
 
@@ -2842,12 +2787,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 +2828,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 +2866,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 );
         }
     }
 
@@ -2958,8 +2900,8 @@ public abstract class AbstractSurefireMojo
         public boolean isApplicable()
         {
             final boolean isJunitArtifact47 = isAnyJunit4( junitArtifact ) && isJunit47Compatible( junitArtifact );
-            final boolean isAny47ProvidersForcers = isAnyConcurrencySelected() || isAnyGroupsSelected();
-            return isAny47ProvidersForcers && ( isJunitArtifact47 || is47CompatibleJunitDep() );
+            final boolean isAny47ProvidersForces = isAnyConcurrencySelected() || isAnyGroupsSelected();
+            return isAny47ProvidersForces && ( isJunitArtifact47 || is47CompatibleJunitDep() );
         }
 
         @Override
@@ -2972,10 +2914,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,9 +2963,9 @@ public abstract class AbstractSurefireMojo
         @Override
         @Nonnull
         public Set<Artifact> getProviderClasspath()
-            throws ArtifactResolutionException, ArtifactNotFoundException
         {
-            return dependencyResolver.addProviderToClasspath( pluginArtifactMap, getMojoArtifact() );
+            return dependencyResolver.addProviderToClasspath( getPluginArtifactMap(), getMojoArtifact(),
+                    getCommonArtifact(), getApiArtifact(), getLoggerApiArtifact() );
         }
     }
 
@@ -3504,17 +3445,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 +3467,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 +3551,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..2f79830 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,33 +19,32 @@ package org.apache.maven.plugin.surefire;
  * under the License.
  */
 
+import java.util.Iterator;
+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;
+import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec;
 
 /**
  * Does dependency resolution and artifact handling for the surefire plugin.
@@ -53,10 +52,26 @@ 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;
+    static final String PROVIDER_GROUP_ID = "org.apache.maven.surefire";
+
+    private static final String[] PROVIDER_CLASSPATH_ORDER = {
+            "surefire-junit3",
+            "surefire-junit4",
+            "surefire-junit47",
+            "surefire-testng",
+            "surefire-junit-platform",
+            "surefire-api",
+            "surefire-logger-api",
+            "common-java5",
+            "common-junit3",
+            "common-junit4",
+            "common-junit48",
+            "common-testng-utils"
+    };
+
+    private final RepositorySystem repositorySystem;
 
     private final ArtifactFactory artifactFactory;
 
@@ -66,27 +81,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 )
+    static boolean isWithinVersionSpec( @Nullable Artifact artifact, @Nonnull String versionSpec )
     {
         if ( artifact == null )
         {
@@ -94,7 +103,7 @@ public class SurefireDependencyResolver
         }
         try
         {
-            VersionRange range = VersionRange.createFromVersionSpec( versionSpec );
+            VersionRange range = createFromVersionSpec( versionSpec );
             try
             {
                 return range.containsVersion( artifact.getSelectedVersion() );
@@ -114,68 +123,99 @@ 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 providerArtifactId, String providerVersion )
     {
-        Artifact providerArtifact = artifactFactory.createDependencyArtifact( "org.apache.maven.surefire",
-                provider, createFromVersion( version ), "jar", null, SCOPE_TEST );
+        Artifact providerArtifact = artifactFactory.createDependencyArtifact( PROVIDER_GROUP_ID,
+                providerArtifactId, createFromVersion( providerVersion ), "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 );
             }
         }
 
-        return result.getArtifacts();
+        return orderProviderArtifacts( result.getArtifacts() );
     }
 
-    public Set<Artifact> addProviderToClasspath( Map<String, Artifact> pluginArtifactMap, Artifact surefireArtifact )
-        throws ArtifactResolutionException, ArtifactNotFoundException
+    Set<Artifact> addProviderToClasspath( Map<String, Artifact> pluginArtifactMap, Artifact mojoPluginArtifact,
+                                          Artifact surefireCommon, Artifact surefireApi, Artifact surefireLoggerApi )
     {
         Set<Artifact> providerArtifacts = new LinkedHashSet<Artifact>();
-        if ( surefireArtifact != null )
+        ArtifactResolutionResult artifactResolutionResult = resolveArtifact( mojoPluginArtifact );
+        for ( Artifact artifact : pluginArtifactMap.values() )
         {
-            ArtifactResolutionResult artifactResolutionResult = resolveArtifact( null, surefireArtifact );
-            for ( Artifact artifact : pluginArtifactMap.values() )
+            if ( !artifactResolutionResult.getArtifacts().contains( artifact ) )
             {
-                if ( !artifactResolutionResult.getArtifacts().contains( artifact ) )
+                providerArtifacts.add( artifact );
+                for ( Artifact dependency : resolveArtifact( artifact ).getArtifacts() )
                 {
-                    providerArtifacts.add( artifact );
+                    String groupId = dependency.getGroupId();
+                    String artifactId = dependency.getArtifactId();
+                    if ( groupId.equals( surefireCommon.getGroupId() )
+                            && artifactId.equals( surefireCommon.getArtifactId() ) )
+                    {
+                        providerArtifacts.add( surefireCommon );
+                    }
+                    else if ( groupId.equals( surefireApi.getGroupId() )
+                            && artifactId.equals( surefireApi.getArtifactId() ) )
+                    {
+                        providerArtifacts.add( surefireApi );
+                    }
+                    else if ( groupId.equals( surefireLoggerApi.getGroupId() )
+                            && artifactId.equals( surefireLoggerApi.getArtifactId() ) )
+                    {
+                        providerArtifacts.add( surefireLoggerApi );
+                    }
                 }
             }
         }
-        else
+        return orderProviderArtifacts( providerArtifacts );
+    }
+
+    private static Set<Artifact> orderProviderArtifacts( Set<Artifact> providerArtifacts )
+    {
+        Set<Artifact> orderedProviderArtifacts = new LinkedHashSet<Artifact>();
+        for ( String order : PROVIDER_CLASSPATH_ORDER )
         {
-            // Bit of a brute force strategy if not found. Should probably be improved
-            providerArtifacts.addAll( pluginArtifactMap.values() );
+            Iterator<Artifact> providerArtifactsIt = providerArtifacts.iterator();
+            while ( providerArtifactsIt.hasNext() )
+            {
+                Artifact providerArtifact = providerArtifactsIt.next();
+                if ( providerArtifact.getArtifactId().equals( order ) )
+                {
+                    orderedProviderArtifacts.add( providerArtifact );
+                    providerArtifactsIt.remove();
+                }
+            }
         }
-        return providerArtifacts;
+        orderedProviderArtifacts.addAll( providerArtifacts );
+        return orderedProviderArtifacts;
     }
 }
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..3e6e2c5 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,8 +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;
 import java.util.Deque;
@@ -185,27 +183,26 @@ public final class SurefireHelper
             cli.add( LOGGING_LEVEL_DEBUG );
         }
 
-        try
+        MavenExecutionRequest request = session.getRequest();
+
+        if ( request.isShowErrors() )
         {
-            Method getRequestMethod = session.getClass().getMethod( "getRequest" );
-            MavenExecutionRequest request = (MavenExecutionRequest) getRequestMethod.invoke( session );
+            cli.add( SHOW_ERRORS );
+        }
 
-            if ( request.isShowErrors() )
+        String failureBehavior = request.getReactorFailureBehavior();
+        if ( failureBehavior != null )
+        {
+            try
             {
-                cli.add( SHOW_ERRORS );
+                cli.add( CommandLineOption.valueOf( failureBehavior ) );
             }
-
-            String f = getFailureBehavior( request );
-            if ( f != null )
+            catch ( IllegalArgumentException e )
             {
-                // compatible with enums Maven 3.0
-                cli.add( CommandLineOption.valueOf( f.startsWith( "REACTOR_" ) ? f : "REACTOR_" + f ) );
+                // CommandLineOption does not have specified enum as string. See getRequest() method in Maven Session.
             }
         }
-        catch ( Exception e )
-        {
-            // don't need to log the exception that Maven 2 does not have getRequest() method in Maven Session
-        }
+
         return unmodifiableList( cli );
     }
 
@@ -250,21 +247,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-common/src/main/java/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.java
index 372740a..88ac446 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.java
@@ -23,8 +23,7 @@ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
 import org.codehaus.plexus.logging.Logger;
 
 /**
- * Wrapper logger of miscellaneous (Maven 2.2.1 or 3.1) implementations of {@link Logger}.
- * Calling {@link Logger#isInfoEnabled()} before {@link Logger#info(String)} due to Maven 2.2.1.
+ * Wrapper logger of miscellaneous implementations of {@link Logger}.
  *
  * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
  * @since 2.20
@@ -49,18 +48,12 @@ public final class PluginConsoleLogger
     @Override
     public void debug( String message )
     {
-        if ( isDebugEnabled() )
-        {
-            plexusLogger.debug( message );
-        }
+        plexusLogger.debug( message );
     }
 
     public void debug( CharSequence content, Throwable error )
     {
-        if ( isDebugEnabled() )
-        {
-            plexusLogger.debug( content == null ? "" : content.toString(), error );
-        }
+        plexusLogger.debug( content == null ? "" : content.toString(), error );
     }
 
     @Override
@@ -72,10 +65,7 @@ public final class PluginConsoleLogger
     @Override
     public void info( String message )
     {
-        if ( isInfoEnabled() )
-        {
-            plexusLogger.info( message );
-        }
+        plexusLogger.info( message );
     }
 
     @Override
@@ -87,18 +77,12 @@ public final class PluginConsoleLogger
     @Override
     public void warning( String message )
     {
-        if ( isWarnEnabled() )
-        {
-            plexusLogger.warn( message );
-        }
+        plexusLogger.warn( message );
     }
 
     public void warning( CharSequence content, Throwable error )
     {
-        if ( isWarnEnabled() )
-        {
-            plexusLogger.warn( content == null ? "" : content.toString(), error );
-        }
+        plexusLogger.warn( content == null ? "" : content.toString(), error );
     }
 
     @Override
@@ -110,27 +94,18 @@ public final class PluginConsoleLogger
     @Override
     public void error( String message )
     {
-        if ( isErrorEnabled() )
-        {
-            plexusLogger.error( message );
-        }
+        plexusLogger.error( message );
     }
 
     @Override
     public void error( String message, Throwable t )
     {
-        if ( isErrorEnabled() )
-        {
-            plexusLogger.error( message, t );
-        }
+        plexusLogger.error( message, t );
     }
 
     @Override
     public void error( Throwable t )
     {
-        if ( isErrorEnabled() )
-        {
-            plexusLogger.error( "", t );
-        }
+        plexusLogger.error( "", t );
     }
 }
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
index 3db6ebd..dd652a8 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
@@ -442,20 +442,19 @@ public class DefaultReporterFactory
 
     private void log( String s, Level level )
     {
-        MessageBuilder builder = buffer();
         switch ( level )
         {
             case FAILURE:
-                consoleLogger.error( builder.failure( s ).toString() );
+                failure( s );
                 break;
             case UNSTABLE:
-                consoleLogger.warning( builder.warning( s ).toString() );
+                warning( s );
                 break;
             case SUCCESS:
-                consoleLogger.info( builder.success( s ).toString() );
+                success( s );
                 break;
             default:
-                consoleLogger.info( builder.a( s ).toString() );
+                info( s );
         }
     }
 
@@ -467,13 +466,13 @@ public class DefaultReporterFactory
     private void info( String s )
     {
         MessageBuilder builder = buffer();
-        consoleLogger.info( builder.info( s ).toString() );
+        consoleLogger.info( builder.a( s ).toString() );
     }
 
-    private void err( String s )
+    private void warning( String s )
     {
         MessageBuilder builder = buffer();
-        consoleLogger.error( builder.error( s ).toString() );
+        consoleLogger.warning( builder.warning( s ).toString() );
     }
 
     private void success( String s )
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
index 0773788..defd575 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
@@ -19,6 +19,7 @@ package org.apache.maven.plugin.surefire.report;
  * under the License.
  */
 
+import org.apache.maven.plugin.surefire.booterclient.output.InPluginProcessDumpSingleton;
 import org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter;
 import org.apache.maven.shared.utils.xml.XMLWriter;
 import org.apache.maven.surefire.report.ReportEntry;
@@ -238,6 +239,14 @@ public class StatelessXmlReporter
             }
             ppw.endElement(); // TestSuite
         }
+        catch ( IOException e )
+        {
+            // It's not a test error.
+            // This method must be sail-safe and errors are in a dump log.
+            // The control flow must not be broken in TestSetRunListener#testSetCompleted.
+            InPluginProcessDumpSingleton.getSingleton()
+                    .dumpException( e, e.getLocalizedMessage(), reportsDirectory );
+        }
         finally
         {
             closeQuietly( fw );
@@ -324,7 +333,7 @@ public class StatelessXmlReporter
     }
 
     private static void startTestElement( XMLWriter ppw, WrappedReportEntry report, String reportNameSuffix,
-                                          String timeAsString )
+                                          String timeAsString ) throws IOException
     {
         ppw.startElement( "testcase" );
         ppw.addAttribute( "name", report.getReportName() );
@@ -347,7 +356,7 @@ public class StatelessXmlReporter
     }
 
     private void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats,
-                                         String timeAsString )
+                                         String timeAsString ) throws IOException
     {
         ppw.startElement( "testsuite" );
 
@@ -374,7 +383,7 @@ public class StatelessXmlReporter
 
     private static void getTestProblems( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
                                          WrappedReportEntry report, boolean trimStackTrace, OutputStream fw,
-                                         String testErrorType, boolean createOutErrElementsInside )
+                                         String testErrorType, boolean createOutErrElementsInside ) throws IOException
     {
         ppw.startElement( testErrorType );
 
@@ -431,7 +440,7 @@ public class StatelessXmlReporter
 
     // Create system-out and system-err elements
     private static void createOutErrElements( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
-                                              WrappedReportEntry report, OutputStream fw )
+                                              WrappedReportEntry report, OutputStream fw ) throws IOException
     {
         EncodingOutputStream eos = new EncodingOutputStream( fw );
         addOutputStreamElement( outputStreamWriter, eos, ppw, report.getStdout(), "system-out" );
@@ -441,7 +450,7 @@ public class StatelessXmlReporter
     private static void addOutputStreamElement( OutputStreamWriter outputStreamWriter,
                                          EncodingOutputStream eos, XMLWriter xmlWriter,
                                          Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream,
-                                         String name )
+                                         String name ) throws IOException
     {
         if ( utf8RecodingDeferredFileOutputStream != null && utf8RecodingDeferredFileOutputStream.getByteCount() > 0 )
         {
@@ -471,7 +480,7 @@ public class StatelessXmlReporter
      *
      * @param xmlWriter The test suite to report to
      */
-    private static void showProperties( XMLWriter xmlWriter, Map<String, String> systemProperties )
+    private static void showProperties( XMLWriter xmlWriter, Map<String, String> systemProperties ) throws IOException
     {
         xmlWriter.startElement( "properties" );
         for ( final Entry<String, String> entry : systemProperties.entrySet() )
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
index 9d3c974..62060f1 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
@@ -193,7 +193,7 @@ public class TestSetRunListener
     }
 
     // ----------------------------------------------------------------------
-    // Test
+    // Test callback methods:
     // ----------------------------------------------------------------------
 
     @Override
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
index 22c3f52..dbe6c8b 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
@@ -217,14 +217,18 @@ public class AbstractSurefireMojoTest
                 createFromVersion( "1" ), "runtime", "jar", "", handler );
         common.setFile( mockFile( "maven-surefire-common.jar" ) );
 
-
         Artifact api = new DefaultArtifact( "org.apache.maven.surefire", "surefire-api",
                 createFromVersion( "1" ), "runtime", "jar", "", handler );
         api.setFile( mockFile( "surefire-api.jar" ) );
 
+        Artifact loggerApi = new DefaultArtifact( "org.apache.maven.surefire", "surefire-logger-api",
+                createFromVersion( "1" ), "runtime", "jar", "", handler );
+        loggerApi.setFile( mockFile( "surefire-logger-api.jar" ) );
+
         Map<String, Artifact> providerArtifactsMap = new HashMap<String, Artifact>();
         providerArtifactsMap.put( "org.apache.maven.surefire:maven-surefire-common", common );
         providerArtifactsMap.put( "org.apache.maven.surefire:surefire-api", api );
+        providerArtifactsMap.put( "org.apache.maven.surefire:surefire-logger-api", loggerApi );
 
         when( mojo.getPluginArtifactMap() )
                 .thenReturn( providerArtifactsMap );
@@ -268,7 +272,6 @@ public class AbstractSurefireMojoTest
         verify( mojo, times( 1 ) ).isChildDelegation();
         verifyPrivate( mojo, times( 1 ) ).invoke( "generateTestClasspath" );
         verify( mojo, times( 1 ) ).getEffectiveForkCount();
-        verify( logger, times( 6 ) ).isDebugEnabled();
         ArgumentCaptor<String> argument = ArgumentCaptor.forClass( String.class );
         verify( logger, times( 6 ) ).debug( argument.capture() );
         assertThat( argument.getAllValues() )
@@ -276,8 +279,8 @@ public class AbstractSurefireMojoTest
                 "provider classpath:  surefire-provider.jar",
                 "test(compact) classpath:  test-classes  classes  junit.jar  hamcrest.jar",
                 "provider(compact) classpath:  surefire-provider.jar",
-                "in-process classpath:  surefire-provider.jar  maven-surefire-common.jar  surefire-api.jar",
-                "in-process(compact) classpath:  surefire-provider.jar  maven-surefire-common.jar  surefire-api.jar"
+                "in-process classpath:  surefire-provider.jar  maven-surefire-common.jar  surefire-api.jar  surefire-logger-api.jar",
+                "in-process(compact) classpath:  surefire-provider.jar  maven-surefire-common.jar  surefire-api.jar  surefire-logger-api.jar"
                 );
 
         assertThat( conf.getClassLoaderConfiguration() )
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java
new file mode 100644
index 0000000..08b389f
--- /dev/null
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java
@@ -0,0 +1,412 @@
+package org.apache.maven.plugin.surefire;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
+import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
+import org.apache.maven.repository.RepositorySystem;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import static java.util.Arrays.asList;
+import static java.util.Collections.singleton;
+import static org.apache.maven.artifact.versioning.VersionRange.createFromVersion;
+import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec;
+import static org.apache.maven.plugin.surefire.SurefireDependencyResolver.PROVIDER_GROUP_ID;
+import static org.fest.assertions.Assertions.assertThat;
+import static org.mockito.Mockito.*;
+import static org.powermock.reflect.Whitebox.invokeMethod;
+
+public class SurefireDependencyResolverTest
+{
+    @Rule
+    public final ExpectedException expectedException = ExpectedException.none();
+
+    @Test
+    public void shouldNotBeWithinRangeNullArtifact()
+    {
+        boolean result = SurefireDependencyResolver.isWithinVersionSpec( null, "[4.7,)" );
+        assertThat( result )
+                .isFalse();
+    }
+
+    @Test
+    public void shouldNotBeWithinRange() throws InvalidVersionSpecificationException
+    {
+        Artifact api = createArtifact( "junit", "junit", "4.6" );
+        boolean result = SurefireDependencyResolver.isWithinVersionSpec( api, "[4.7,)" );
+        assertThat( result )
+                .isFalse();
+    }
+
+    @Test
+    public void shouldBeWithinRange() throws InvalidVersionSpecificationException
+    {
+        Artifact api = createArtifact( "junit", "junit", "4.7" );
+        boolean result = SurefireDependencyResolver.isWithinVersionSpec( api, "[4.7,)" );
+        assertThat( result )
+                .isTrue();
+    }
+
+    @Test
+    public void shouldBeFarWithinRange() throws InvalidVersionSpecificationException
+    {
+        Artifact api = createArtifact( "junit", "junit", "4.13" );
+        boolean result = SurefireDependencyResolver.isWithinVersionSpec( api, "[4.7,)" );
+        assertThat( result )
+                .isTrue();
+    }
+
+    @Test
+    public void shouldBeFailWithinRange() throws InvalidVersionSpecificationException
+    {
+        Artifact api = createArtifact( "junit", "junit", "" );
+        expectedException.expect( RuntimeException.class );
+        expectedException.expectMessage( "Bug in plugin. Please report with stacktrace" );
+        SurefireDependencyResolver.isWithinVersionSpec( api, "[4.7,)" );
+    }
+
+    @Test
+    public void testResolveArtifact() throws InvalidVersionSpecificationException
+    {
+        final Artifact provider = createArtifact( "surefire-junit-platform" );
+        RepositorySystem repositorySystem = mock( RepositorySystem.class );
+        final ArtifactResolutionResult expectedResult = mock( ArtifactResolutionResult.class );
+        when( repositorySystem.resolve( any(  ArtifactResolutionRequest.class) ) )
+                .then( new Answer<ArtifactResolutionResult>() {
+                    @Override
+                    public ArtifactResolutionResult answer( InvocationOnMock invocation )
+                    {
+                        Object[] args = invocation.getArguments();
+                        assertThat( args )
+                                .hasSize( 1 );
+                        ArtifactResolutionRequest request = (ArtifactResolutionRequest) args[0];
+                        assertThat( request.getArtifact() )
+                                .isSameAs( provider );
+                        assertThat( request.isResolveTransitively() )
+                                .isTrue();
+                        assertThat( request.getArtifactDependencies() )
+                                .isNull();
+                        assertThat( request.getRemoteRepositories() )
+                                .isNull();
+                        assertThat( request.getLocalRepository() )
+                                .isNull();
+                        assertThat( request.getCache() )
+                                .isNull();
+                        assertThat( request.getCollectionFilter() )
+                                .isNull();
+                        assertThat( request.getManagedVersionMap() )
+                                .isNull();
+                        assertThat( request.getMirrors() )
+                                .isEmpty();
+                        assertThat( request.getProxies() )
+                                .isEmpty();
+                        assertThat( request.getResolutionFilter() )
+                                .isNull();
+                        assertThat( request.getServers() )
+                                .isEmpty();
+                        return expectedResult;
+                    }
+                } );
+
+        SurefireDependencyResolver surefireDependencyResolver =
+                new SurefireDependencyResolver( repositorySystem, null, null, null, null, null );
+
+        ArtifactResolutionResult actualResult = surefireDependencyResolver.resolveArtifact( provider );
+
+        assertThat( actualResult )
+                .isSameAs( expectedResult );
+    }
+
+    @Test
+    public void testGetProviderClasspath() throws Exception
+    {
+        Artifact api = createArtifact( "surefire-api" );
+        api.setFile( new File( "" ) );
+
+        final Artifact provider = createArtifact( "surefire-junit-platform" );
+        provider.setFile( new File( "" ) );
+
+        Artifact ext = createArtifact( "org.apiguardian", "apiguardian-api" );
+        ext.setFile( new File( "" ) );
+
+        Artifact logger = createArtifact( "surefire-logger-api" );
+        logger.setFile( new File( "" ) );
+
+        Set<Artifact> providerArtifacts = new LinkedHashSet<Artifact>();
+        providerArtifacts.add( api );
+        providerArtifacts.add( provider );
+        providerArtifacts.add( ext );
+        providerArtifacts.add( logger );
+
+        ArtifactFactory artifactFactory = mock( ArtifactFactory.class );
+        VersionRange providerVersion = createFromVersion( "5.3.1" );
+        when( artifactFactory.createDependencyArtifact( eq( "org.apache.maven.surefire" ),
+                eq( "surefire-junit-platform" ),
+                eq( providerVersion ),
+                eq( "jar" ),
+                isNull( String.class ),
+                eq( "test" ) ) )
+                .thenReturn( provider );
+
+        final ArtifactResolutionResult result = mock( ArtifactResolutionResult.class );
+        when( result.getArtifacts() )
+                .thenReturn( providerArtifacts );
+
+        RepositorySystem repositorySystem = mock( RepositorySystem.class );
+        when( repositorySystem.resolve( any(  ArtifactResolutionRequest.class) ) )
+                .then( new Answer<ArtifactResolutionResult>() {
+                    @Override
+                    public ArtifactResolutionResult answer( InvocationOnMock invocation )
+                    {
+                        Object[] args = invocation.getArguments();
+                        assertThat( args )
+                                .hasSize( 1 );
+                        ArtifactResolutionRequest request = (ArtifactResolutionRequest) args[0];
+                        assertThat( request.getArtifact() )
+                                .isSameAs( provider );
+                        assertThat( request.isResolveTransitively() )
+                                .isTrue();
+                        assertThat( request.getArtifactDependencies() )
+                                .isNull();
+                        assertThat( request.getRemoteRepositories() )
+                                .isNull();
+                        assertThat( request.getLocalRepository() )
+                                .isNull();
+                        assertThat( request.getCache() )
+                                .isNull();
+                        assertThat( request.getCollectionFilter() )
+                                .isNull();
+                        assertThat( request.getManagedVersionMap() )
+                                .isNull();
+                        assertThat( request.getMirrors() )
+                                .isEmpty();
+                        assertThat( request.getProxies() )
+                                .isEmpty();
+                        assertThat( request.getResolutionFilter() )
+                                .isNull();
+                        assertThat( request.getServers() )
+                                .isEmpty();
+                        return result;
+                    }
+                } );
+
+        ConsoleLogger log = mock( ConsoleLogger.class );
+
+        SurefireDependencyResolver surefireDependencyResolver =
+                new SurefireDependencyResolver( repositorySystem, artifactFactory, log, null, null, null );
+
+        when( log.isDebugEnabled() )
+                .thenReturn( true );
+
+        Set<Artifact> classpath = surefireDependencyResolver.getProviderClasspath( "surefire-junit-platform", "5.3.1" );
+
+        assertThat( classpath )
+                .hasSize( 4 );
+
+        Iterator<Artifact> it = classpath.iterator();
+
+        assertThat( it.next() )
+                .isSameAs( provider );
+
+        assertThat( it.next() )
+                .isSameAs( api );
+
+        assertThat( it.next() )
+                .isSameAs( logger );
+
+        assertThat( it.next() )
+                .isSameAs( ext );
+    }
+
+    @Test
+    public void testAddProviderToClasspath() throws Exception
+    {
+        final Artifact plugin = createArtifact( "maven-surefire-plugin" );
+        final Artifact common = createArtifact( "maven-surefire-common" );
+        final Artifact api = createArtifact( "surefire-api" );
+        final Artifact provider = createArtifact( "surefire-junit-platform" );
+        final Artifact ext = createArtifact( "org.apiguardian", "apiguardian-api" );
+        final Artifact logger = createArtifact( "surefire-logger-api" );
+
+        Set<Artifact> pluginArtifacts = new LinkedHashSet<Artifact>();
+        pluginArtifacts.add( plugin );
+        pluginArtifacts.add( common );
+        pluginArtifacts.add( api );
+        pluginArtifacts.add( logger );
+
+        ArtifactFactory artifactFactory = mock( ArtifactFactory.class );
+        VersionRange pluginVersion = createFromVersion( "3.0.0" );
+        when( artifactFactory.createDependencyArtifact( eq( "org.apache.maven.surefire" ),
+                eq( "maven-surefire-plugin" ),
+                eq( pluginVersion ),
+                eq( "jar" ),
+                isNull( String.class ),
+                eq( "compile" ) ) )
+                .thenReturn( plugin );
+
+        final ArtifactResolutionResult pluginResult = mock( ArtifactResolutionResult.class );
+        when( pluginResult.getArtifacts() )
+                .thenReturn( pluginArtifacts );
+
+        final ArtifactResolutionResult apiResult = mock( ArtifactResolutionResult.class );
+        when( apiResult.getArtifacts() )
+                .thenReturn( singleton( api ) );
+
+        final ArtifactResolutionResult loggerResult = mock( ArtifactResolutionResult.class );
+        when( loggerResult.getArtifacts() )
+                .thenReturn( singleton( logger ) );
+
+        final ArtifactResolutionResult extResult = mock( ArtifactResolutionResult.class );
+        when( extResult.getArtifacts() )
+                .thenReturn( singleton( ext ) );
+
+        final ArtifactResolutionResult providerResult = mock( ArtifactResolutionResult.class );
+        when( providerResult.getArtifacts() )
+                .thenReturn( new HashSet<Artifact>( asList( provider, api, logger, ext ) ) );
+
+        RepositorySystem repositorySystem = mock( RepositorySystem.class );
+        when( repositorySystem.resolve( any(  ArtifactResolutionRequest.class) ) )
+                .then( new Answer<ArtifactResolutionResult>() {
+                    @Override
+                    public ArtifactResolutionResult answer( InvocationOnMock invocation )
+                    {
+                        Object[] args = invocation.getArguments();
+                        assertThat( args ).hasSize( 1 );
+                        ArtifactResolutionRequest request = (ArtifactResolutionRequest) args[0];
+                        Artifact artifactToResolve = request.getArtifact();
+                        if ( artifactToResolve == plugin )
+                        {
+                            return pluginResult;
+                        }
+                        else if ( artifactToResolve == provider )
+                        {
+                            return providerResult;
+                        }
+                        else if ( artifactToResolve == api )
+                        {
+                            return apiResult;
+                        }
+                        else if ( artifactToResolve == logger )
+                        {
+                            return loggerResult;
+                        }
+                        else if ( artifactToResolve == ext )
+                        {
+                            return extResult;
+                        }
+                        throw new AssertionError( "what artifact are we going to resolve? " + artifactToResolve );
+                    }
+                } );
+
+        SurefireDependencyResolver surefireDependencyResolver =
+                new SurefireDependencyResolver( repositorySystem, null, null, null, null, null );
+
+        Map<String, Artifact> pluginArtifactsMapping = new HashMap<String, Artifact>();
+        pluginArtifactsMapping.put( plugin.getGroupId() + ":" + plugin.getArtifactId(), plugin );
+        pluginArtifactsMapping.put( common.getGroupId() + ":" + common.getArtifactId(), common );
+        pluginArtifactsMapping.put( api.getGroupId() + ":" + api.getArtifactId(), api );
+        pluginArtifactsMapping.put( logger.getGroupId() + ":" + logger.getArtifactId(), logger );
+        pluginArtifactsMapping.put( provider.getGroupId() + ":" + provider.getArtifactId(), provider );
+        pluginArtifactsMapping.put( ext.getGroupId() + ":" + ext.getArtifactId(), ext );
+
+        Set<Artifact> cp = surefireDependencyResolver.addProviderToClasspath( pluginArtifactsMapping, plugin, common, api, logger );
+        assertThat( cp )
+                .hasSize( 4 )
+                .containsOnly( provider, api, logger, ext );
+    }
+
+    @Test
+    public void shouldOrderedProviderArtifacts() throws Exception
+    {
+        Artifact api = createArtifact( "surefire-api" );
+        Artifact provider = createArtifact( "surefire-junit-platform" );
+        Artifact ext = createArtifact( "org.apiguardian", "apiguardian-api" );
+        Artifact logger = createArtifact( "surefire-logger-api" );
+
+        Set<Artifact> providerArtifacts = new LinkedHashSet<Artifact>();
+        providerArtifacts.add( api );
+        providerArtifacts.add( provider );
+        providerArtifacts.add( ext );
+        providerArtifacts.add( logger );
+
+        Iterator<Artifact> it = providerArtifacts.iterator();
+
+        assertThat( it.next() )
+                .isEqualTo( api );
+
+        assertThat( it.next() )
+                .isEqualTo( provider );
+
+        assertThat( it.next() )
+                .isEqualTo( ext );
+
+        assertThat( it.next() )
+                .isEqualTo( logger );
+
+        Set<Artifact> actual =
+                invokeMethod( SurefireDependencyResolver.class, "orderProviderArtifacts", providerArtifacts );
+
+        Set<Artifact> expected = new LinkedHashSet<Artifact>();
+        expected.add( provider );
+        expected.add( api );
+        expected.add( logger );
+        expected.add( ext );
+
+        assertThat( actual )
+                .isEqualTo( expected );
+    }
+
+    private static Artifact createArtifact( String artifactId ) throws InvalidVersionSpecificationException
+    {
+        return createArtifact( PROVIDER_GROUP_ID, artifactId );
+    }
+
+
+    private static Artifact createArtifact( String groupId, String artifactId )
+            throws InvalidVersionSpecificationException
+    {
+        return createArtifact(groupId, artifactId, "1");
+    }
+
+    private static Artifact createArtifact( String groupId, String artifactId, String version )
+            throws InvalidVersionSpecificationException
+    {
+        VersionRange versionSpec = createFromVersionSpec( version );
+        return new DefaultArtifact( groupId, artifactId, versionSpec, "compile", "jar", "", null );
+    }
+}
diff --git a/maven-surefire-plugin/pom.xml b/maven-surefire-plugin/pom.xml
index 9ac4d00..0c210ee 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>
@@ -47,6 +47,7 @@
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>maven-surefire-common</artifactId>
+      <version>${project.version}</version>
     </dependency>
   </dependencies>
 
diff --git a/maven-surefire-plugin/src/site/apt/index.apt.vm b/maven-surefire-plugin/src/site/apt/index.apt.vm
index f7270fc..7482ae6 100644
--- a/maven-surefire-plugin/src/site/apt/index.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/index.apt.vm
@@ -31,7 +31,7 @@
 Maven ${thisPlugin} Plugin
 
 
-  Requirements: Maven 2.2.1 or 3.x, and JDK 1.6 or higher. Due to wrong formatting of console text messages
+  Requirements: Maven 3.x and JDK 1.7 or higher. Due to wrong formatting of console text messages
   in Maven Version prior to 3.1.0 it is highly recommended to use Maven 3.1.0 or higher.
 
 #{if}(${project.artifactId}=="maven-surefire-plugin")
diff --git a/maven-surefire-report-plugin/pom.xml b/maven-surefire-report-plugin/pom.xml
index 9e04880..1be8732 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>
@@ -77,30 +77,26 @@
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-impl</artifactId>
-      <version>2.4</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-site-renderer</artifactId>
-      <version>1.6</version>
-    </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 -->
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-      <version>3.0.15</version>
     </dependency>
     <dependency>
       <groupId>org.fusesource.jansi</groupId>
       <artifactId>jansi</artifactId>
-      <version>1.13</version>
       <scope>provided</scope>
     </dependency>
     <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <scope>test</scope>
+    </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,24 +150,6 @@
         </executions>
       </plugin>
       <plugin>
-        <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/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>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <useSystemClassLoader>true</useSystemClassLoader>
@@ -186,7 +164,6 @@
   <reporting>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-plugin-plugin</artifactId>
       </plugin>
     </plugins>
@@ -233,7 +210,6 @@
             </configuration>
           </plugin>
           <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-changes-plugin</artifactId>
             <configuration>
               <skip>false</skip>
diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/PluginConsoleLogger.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/PluginConsoleLogger.java
index 0e0fb99..5070364 100644
--- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/PluginConsoleLogger.java
+++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/PluginConsoleLogger.java
@@ -27,8 +27,7 @@ import static java.lang.Integer.numberOfLeadingZeros;
 import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
 
 /**
- * Wrapper logger of miscellaneous (Maven 2.2.1 or 3.1) implementations of {@link Log}.
- * Calling {@link Log#isInfoEnabled()} before {@link Log#info(CharSequence)} due to Maven 2.2.1.
+ * Wrapper logger of miscellaneous implementations of {@link Log}.
  *
  * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
  * @since 2.20
@@ -53,18 +52,12 @@ final class PluginConsoleLogger
     @Override
     public void debug( String message )
     {
-        if ( mojoLogger.isDebugEnabled() )
-        {
-            mojoLogger.debug( createAnsiBuilder( message ).debug( message ).toString() );
-        }
+        mojoLogger.debug( createAnsiBuilder( message ).a( message ).toString() );
     }
 
     public void debug( CharSequence content, Throwable error )
     {
-        if ( mojoLogger.isDebugEnabled() )
-        {
-            mojoLogger.debug( content, error );
-        }
+        mojoLogger.debug( content, error );
     }
 
     @Override
@@ -76,10 +69,7 @@ final class PluginConsoleLogger
     @Override
     public void info( String message )
     {
-        if ( mojoLogger.isInfoEnabled() )
-        {
-            mojoLogger.info( createAnsiBuilder( message ).info( message ).toString() );
-        }
+        mojoLogger.info( createAnsiBuilder( message ).a( message ).toString() );
     }
 
     @Override
@@ -91,18 +81,12 @@ final class PluginConsoleLogger
     @Override
     public void warning( String message )
     {
-        if ( mojoLogger.isWarnEnabled() )
-        {
-            mojoLogger.warn( createAnsiBuilder( message ).warning( message ).toString() );
-        }
+        mojoLogger.warn( createAnsiBuilder( message ).warning( message ).toString() );
     }
 
     public void warn( CharSequence content, Throwable error )
     {
-        if ( mojoLogger.isWarnEnabled() )
-        {
-            mojoLogger.warn( content, error );
-        }
+        mojoLogger.warn( content, error );
     }
 
     @Override
@@ -114,28 +98,19 @@ final class PluginConsoleLogger
     @Override
     public void error( String message )
     {
-        if ( mojoLogger.isErrorEnabled() )
-        {
-            mojoLogger.error( createAnsiBuilder( message ).error( message ).toString() );
-        }
+        mojoLogger.error( createAnsiBuilder( message ).failure( message ).toString() );
     }
 
     @Override
     public void error( String message, Throwable t )
     {
-        if ( mojoLogger.isErrorEnabled() )
-        {
-            mojoLogger.error( message, t );
-        }
+        mojoLogger.error( message, t );
     }
 
     @Override
     public void error( Throwable t )
     {
-        if ( mojoLogger.isErrorEnabled() )
-        {
-            mojoLogger.error( t );
-        }
+        mojoLogger.error( t );
     }
 
     private static MessageBuilder createAnsiBuilder( CharSequence message )
diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
index 6c02ad9..4febdd1 100644
--- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
+++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
@@ -26,7 +26,7 @@ import java.util.Locale;
 import java.util.Map;
 import org.apache.maven.doxia.markup.HtmlMarkup;
 import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.doxia.sink.SinkEventAttributeSet;
+import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
 import org.apache.maven.doxia.util.DoxiaUtils;
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
 import org.apache.maven.reporting.MavenReportException;
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
index 1169d67..64c583e 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
@@ -520,7 +520,7 @@ public class SurefireReportMojoTest
         + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)\n"
         + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n"
         + "\tat surefire.MyTest.access$200(MyTest.java:9)\n"
-        + "\tat surefire.MyTest$A.t(MyTest.java:45)"
+        + "\tat surefire.MyTest$A.t(MyTest.java:45)\n"
         + "</pre>" ) ) );
     }
 
@@ -614,7 +614,8 @@ public class SurefireReportMojoTest
                 + "\tat surefire.MyTest.failure(MyTest.java:33)\n" + "\tat surefire.MyTest.access$100(MyTest.java:9)\n"
                 + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n"
                 + "\tat surefire.MyTest.delegate(MyTest.java:29)\n"
-                + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)" + "</pre>" ) ) );
+                + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)\n"
+                + "</pre>" ) ) );
     }
 
     /**
diff --git a/pom.xml b/pom.xml
index 99c9746..e9a8c3f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,11 +84,11 @@
   </distributionManagement>
 
   <properties>
-    <mavenVersion>2.2.1</mavenVersion>
+    <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.2.1</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>
@@ -102,11 +102,6 @@
   <dependencyManagement>
     <dependencies>
       <dependency>
-        <groupId>org.apache.maven.surefire</groupId>
-        <artifactId>surefire-api</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-lang3</artifactId>
         <version>${commonsLang3Version}</version>
@@ -117,29 +112,9 @@
         <version>${commonsIoVersion}</version>
       </dependency>
       <dependency>
-        <groupId>org.apache.maven.surefire</groupId>
-        <artifactId>surefire-booter</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.maven.surefire</groupId>
-        <artifactId>surefire-logger-api</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.maven.surefire</groupId>
-        <artifactId>surefire-grouper</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.maven.surefire</groupId>
-        <artifactId>maven-surefire-common</artifactId>
-        <version>${project.version}</version>
-      </dependency>
-      <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>
@@ -189,7 +164,6 @@
         <groupId>org.apache.maven.plugin-tools</groupId>
         <artifactId>maven-plugin-annotations</artifactId>
         <version>${mavenPluginToolsVersion}</version>
-        <scope>compile</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
@@ -198,22 +172,12 @@
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
-        <artifactId>maven-plugin-descriptor</artifactId>
-        <version>${mavenVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.maven</groupId>
-        <artifactId>maven-project</artifactId>
-        <version>${mavenVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.maven</groupId>
         <artifactId>maven-model</artifactId>
         <version>${mavenVersion}</version>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
-        <artifactId>maven-toolchain</artifactId>
+        <artifactId>maven-compat</artifactId>
         <version>${mavenVersion}</version>
       </dependency>
       <dependency>
@@ -227,15 +191,35 @@
         <version>${mavenSharedUtilsVersion}</version>
         <exclusions>
           <exclusion>
-            <groupId>com.google.code.findbugs</groupId>
-            <artifactId>jsr305</artifactId>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.reporting</groupId>
+        <artifactId>maven-reporting-impl</artifactId>
+        <version>3.0.0</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-project</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
           </exclusion>
         </exclusions>
       </dependency>
       <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-toolchain</artifactId>
+        <version>3.0-alpha-2</version>
+      </dependency>
+      <dependency>
         <groupId>org.apache.maven.shared</groupId>
         <artifactId>maven-common-artifact-filters</artifactId>
-        <version>1.3</version>
+        <version>3.0.1</version>
         <exclusions>
           <exclusion>
             <groupId>org.apache.maven.shared</groupId>
@@ -259,6 +243,16 @@
         <version>0.9.10</version>
       </dependency>
       <dependency>
+        <groupId>org.junit.platform</groupId>
+        <artifactId>junit-platform-launcher</artifactId>
+        <version>1.3.1</version>
+      </dependency>
+      <dependency>
+        <groupId>org.junit.jupiter</groupId>
+        <artifactId>junit-jupiter-engine</artifactId>
+        <version>5.3.1</version>
+      </dependency>
+      <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito-core</artifactId>
         <version>2.21.0</version>
@@ -277,7 +271,6 @@
         <groupId>org.powermock</groupId>
         <artifactId>powermock-core</artifactId>
         <version>${powermockVersion}</version>
-        <scope>test</scope>
         <exclusions>
           <exclusion>
             <groupId>net.bytebuddy</groupId>
@@ -303,13 +296,11 @@
         <groupId>org.powermock</groupId>
         <artifactId>powermock-module-junit4</artifactId>
         <version>${powermockVersion}</version>
-        <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>org.powermock</groupId>
         <artifactId>powermock-api-mockito2</artifactId>
         <version>${powermockVersion}</version>
-        <scope>test</scope>
       </dependency>
       <!-- END: PowerMock@Java9 -->
       <dependency>
@@ -514,7 +505,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-enforcer-plugin</artifactId>
-        <version>3.0.0-M1</version>
+        <version>3.0.0-M2</version>
         <executions>
           <execution>
             <id>enforce-java</id>
@@ -525,7 +516,7 @@
               <rules>
                 <requireJavaVersion>
                   <!-- We use JDK 1.8 to check -Xdoclint:all at compile time but with javac -source 1.6 -target 1.6 -->
-                  <!-- enforcer:1.3.1 fails on jdk9. 3.0.0-M1 does not but surefire:12.2.4 crashes later. -->
+                  <!-- enforcer:1.3.1 fails on jdk9. 3.0.0-M2 does not but surefire:12.2.4 crashes later. -->
                   <version>[1.8, 1.9)</version>
                 </requireJavaVersion>
               </rules>
@@ -630,28 +621,6 @@
   <profiles>
     <profile>
       <id>reporting</id>
-      <build>
-        <pluginManagement>
-          <plugins>
-            <!-- Moving to a profile, since these dependencies won't exist the first
-                 time a new snapshot version is built. This prevents the first
-                 snapshot build from proceeding beyond the build for the top-level 
-                 Surefire parent POM.
-            -->
-            <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-site-plugin</artifactId>
-              <dependencies>
-                <!-- dependency>
-                  <groupId>org.apache.maven.surefire</groupId>
-                  <artifactId>surefire-shadefire</artifactId>
-                  <version>${project.version}</version>
-                </dependency -->
-              </dependencies>
-            </plugin>
-          </plugins>
-        </pluginManagement>
-      </build>
       <reporting>
         <plugins>
           <plugin>
@@ -671,37 +640,5 @@
         </plugins>
       </reporting>
     </profile>
-    <profile>
-      <id>m2e</id>
-      <properties>
-        <m2BuildDirectory>target</m2BuildDirectory>
-      </properties>
-      <activation>
-        <property>
-          <name>m2e.version</name>
-        </property>
-      </activation>
-      <build>
-        <directory>${m2BuildDirectory}</directory>
-        <plugins>
-          <plugin>
-            <groupId>org.maven.ide.eclipse</groupId>
-            <artifactId>lifecycle-mapping</artifactId>
-            <version>0.10.0</version>
-            <configuration>
-              <mappingId>customizable</mappingId>
-              <configurators>
-                <configurator id="org.maven.ide.eclipse.jdt.javaConfigurator" />
-                <configurator id="org.maven.ide.eclipse.modello.modelloConfigurator" />
-                <configurator id="org.maven.ide.eclipse.plexus.annotations.plexusConfigurator" />
-              </configurators>
-              <mojoExecutions>
-                <mojoExecution>org.apache.maven.plugins:maven-resources-plugin::</mojoExecution>
-              </mojoExecutions>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
   </profiles>
 </project>
diff --git a/surefire-api/pom.xml b/surefire-api/pom.xml
index 2e5f41c..b432b01 100644
--- a/surefire-api/pom.xml
+++ b/surefire-api/pom.xml
@@ -35,6 +35,7 @@
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-logger-api</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
@@ -65,7 +66,6 @@
         </dependencies>
       </plugin>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
         <executions>
           <execution>
@@ -83,7 +83,7 @@
               <relocations>
                 <relocation>
                   <pattern>org.apache.maven.shared</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.api.org.apache.maven.shared</shadedPattern>
                 </relocation>
               </relocations>
             </configuration>
diff --git a/surefire-booter/pom.xml b/surefire-booter/pom.xml
index 570c0a0..bab1175 100644
--- a/surefire-booter/pom.xml
+++ b/surefire-booter/pom.xml
@@ -35,6 +35,7 @@
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-api</artifactId>
+      <version>${project.version}</version>
       <exclusions>
         <exclusion>
           <groupId>org.apache.maven.shared</groupId>
@@ -126,7 +127,6 @@
         </configuration>
       </plugin>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
         <executions>
           <execution>
@@ -145,11 +145,11 @@
               <relocations>
                 <relocation>
                   <pattern>org.apache.commons.lang3</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.commons.lang3</shadedPattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.booter.org.apache.commons.lang3</shadedPattern>
                 </relocation>
                 <relocation>
                   <pattern>org.apache.commons.io</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.commons.io</shadedPattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.booter.org.apache.commons.io</shadedPattern>
                 </relocation>
               </relocations>
             </configuration>
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/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java
index 42a2b63..332cbb9 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java
@@ -86,7 +86,7 @@ public class JUnitPlatformEnginesIT
     {
         OutputValidator validator = unpack( "junit-platform", '-' + platform )
                 .sysProp( "jupiter.version", jupiter )
-                .addGoal( "-X" )
+                .debugLogging()
                 .executeTest()
                 .verifyErrorFree( 1 );
 
@@ -111,9 +111,10 @@ public class JUnitPlatformEnginesIT
 
         String providerClasspath = "[DEBUG] provider(compact) classpath:"
                 + "  surefire-junit-platform-*.jar"
-                + "  junit-platform-launcher-1.3.1.jar"
                 + "  surefire-api-*.jar"
-                + "  surefire-logger-api-*.jar";
+                + "  surefire-logger-api-*.jar"
+                + "  common-java5-*.jar"
+                + "  junit-platform-launcher-1.3.1.jar";
 
         lines = validator.loadLogLines( startsWith( "[DEBUG] provider(compact) classpath" ) );
 
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-its/src/test/resources/test-helper-dump-pid-plugin/pom.xml b/surefire-its/src/test/resources/test-helper-dump-pid-plugin/pom.xml
index 0c4a15e..e893fec 100644
--- a/surefire-its/src/test/resources/test-helper-dump-pid-plugin/pom.xml
+++ b/surefire-its/src/test/resources/test-helper-dump-pid-plugin/pom.xml
@@ -20,7 +20,7 @@
 		<dependency>
 			<groupId>org.apache.maven</groupId>
 			<artifactId>maven-plugin-api</artifactId>
-			<version>2.2.1</version>
+			<version>3.0</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.maven.plugin-tools</groupId>
diff --git a/surefire-its/src/test/resources/testng-listeners/src/test/java/listeners/MarkAsFailureListener.java b/surefire-its/src/test/resources/testng-listeners/src/test/java/listeners/MarkAsFailureListener.java
index 5ba401f..a104604 100644
--- a/surefire-its/src/test/resources/testng-listeners/src/test/java/listeners/MarkAsFailureListener.java
+++ b/surefire-its/src/test/resources/testng-listeners/src/test/java/listeners/MarkAsFailureListener.java
@@ -31,12 +31,12 @@ import org.testng.ITestResult;
  */
 public class MarkAsFailureListener implements ITestListener, IInvokedMethodListener {
 
-    //todo add @Override in surefire 3.0 running on the top of JDK 6
+    @Override
     public void onTestStart(ITestResult result) {
 
     }
 
-    //todo add @Override in surefire 3.0 running on the top of JDK 6
+    @Override
     public void onTestSuccess(ITestResult result) {
 
     }
@@ -46,37 +46,37 @@ public class MarkAsFailureListener implements ITestListener, IInvokedMethodListe
      * I will be called twice in some condition!!!
      * @param result
      */
-    //todo add @Override in surefire 3.0 running on the top of JDK 6
+    @Override
     public void onTestFailure(ITestResult result) {
         System.out.println(++counter);
     }
 
-    //todo add @Override in surefire 3.0 running on the top of JDK 6
+    @Override
     public void onTestSkipped(ITestResult result) {
 
     }
 
-    //todo add @Override in surefire 3.0 running on the top of JDK 6
+    @Override
     public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
 
     }
 
-    //todo add @Override in surefire 3.0 running on the top of JDK 6
+    @Override
     public void onStart(ITestContext context) {
 
     }
 
-    //todo add @Override in surefire 3.0 running on the top of JDK 6
+    @Override
     public void onFinish(ITestContext context) {
 
     }
 
-    //todo add @Override in surefire 3.0 running on the top of JDK 6
+    @Override
     public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
 
     }
 
-    //todo add @Override in surefire 3.0 running on the top of JDK 6
+    @Override
     public void afterInvocation(IInvokedMethod method, ITestResult testResult) {
         testResult.setStatus(ITestResult.FAILURE);
     }
diff --git a/surefire-providers/common-java5/pom.xml b/surefire-providers/common-java5/pom.xml
index 0d0bc78..6fe9f44 100644
--- a/surefire-providers/common-java5/pom.xml
+++ b/surefire-providers/common-java5/pom.xml
@@ -41,7 +41,6 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
         <executions>
           <execution>
@@ -51,10 +50,15 @@
             </goals>
             <configuration>
               <minimizeJar>true</minimizeJar>
+              <artifactSet>
+                <includes>
+                  <include>org.apache.maven.shared:maven-shared-utils</include>
+                </includes>
+              </artifactSet>
               <relocations>
                 <relocation>
-                  <pattern>org.codehaus.plexus.util</pattern>
-                  <shadedPattern>org.apache.maven.surefire.commonjunit48.org.codehaus.plexus.util</shadedPattern>
+                  <pattern>org.apache.maven.shared</pattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.java5.org.apache.maven.shared</shadedPattern>
                 </relocation>
               </relocations>
             </configuration>
diff --git a/surefire-providers/common-junit4/pom.xml b/surefire-providers/common-junit4/pom.xml
index c109674..071d7fd 100644
--- a/surefire-providers/common-junit4/pom.xml
+++ b/surefire-providers/common-junit4/pom.xml
@@ -51,7 +51,6 @@
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-shared-utils</artifactId>
-      <scope>compile</scope><!-- somewhere managed with scope provided -->
     </dependency>
   </dependencies>
 </project>
diff --git a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerFactory.java b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerFactory.java
index 514e7fb..21d0cc9 100644
--- a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerFactory.java
+++ b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerFactory.java
@@ -22,11 +22,12 @@ package org.apache.maven.surefire.common.junit4;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.maven.shared.utils.StringUtils;
 import org.apache.maven.surefire.util.ReflectionUtils;
 
 import org.junit.runner.notification.RunListener;
 
+import static org.apache.maven.surefire.util.internal.StringUtils.isNotBlank;
+
 /**
  * @author Kristian Rosenvold
  */
@@ -35,12 +36,12 @@ public class JUnit4RunListenerFactory
     public static List<RunListener> createCustomListeners( String listeners )
     {
         List<RunListener> result = new ArrayList<RunListener>();
-        if ( StringUtils.isNotBlank( listeners ) )
+        if ( isNotBlank( listeners ) )
         {
             ClassLoader cl = Thread.currentThread().getContextClassLoader();
             for ( String listener : listeners.split( "," ) )
             {
-                if ( StringUtils.isNotBlank( listener ) )
+                if ( isNotBlank( listener ) )
                 {
                     result.add( ReflectionUtils.instantiate( cl, listener, RunListener.class ) );
                 }
diff --git a/surefire-providers/common-junit48/pom.xml b/surefire-providers/common-junit48/pom.xml
index 38e7e41..f014f7f 100644
--- a/surefire-providers/common-junit48/pom.xml
+++ b/surefire-providers/common-junit48/pom.xml
@@ -42,48 +42,22 @@
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>common-junit4</artifactId>
       <version>${project.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>junit</groupId>
-          <artifactId>junit</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-grouper</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-shared-utils</artifactId>
+      <scope>test</scope>
     </dependency>
   </dependencies>
 
   <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-providers/pom.xml b/surefire-providers/pom.xml
index 73b4248..85826d2 100644
--- a/surefire-providers/pom.xml
+++ b/surefire-providers/pom.xml
@@ -50,6 +50,7 @@
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-api</artifactId>
+      <version>${project.version}</version>
     </dependency>
   </dependencies>
 
diff --git a/surefire-providers/surefire-junit-platform/pom.xml b/surefire-providers/surefire-junit-platform/pom.xml
index fc93e74..e5c4897 100644
--- a/surefire-providers/surefire-junit-platform/pom.xml
+++ b/surefire-providers/surefire-junit-platform/pom.xml
@@ -27,11 +27,14 @@
     </parent>
 
     <artifactId>surefire-junit-platform</artifactId>
+
     <name>SureFire JUnit Platform Runner</name>
     <description>SureFire JUnit Platform Runner</description>
+
     <properties>
         <javaVersion>8</javaVersion>
     </properties>
+
     <contributors>
         <contributor>
             <name>Konstantin Lutovich</name>
@@ -86,12 +89,10 @@
         <dependency>
             <groupId>org.junit.platform</groupId>
             <artifactId>junit-platform-launcher</artifactId>
-            <version>1.3.1</version>
         </dependency>
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter-engine</artifactId>
-            <version>5.3.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -134,42 +135,12 @@
                 </executions>
             </plugin>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.12.4</version> <!-- ${shadedVersion}, but resolved due to https://issues.apache.org/jira/browse/MRELEASE-799 -->
                 <configuration>
                     <jvm>${java.home}/bin/java</jvm>
                 </configuration>
             </plugin>
-            <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.apache.maven.surefire:common-java5</include>
-                                </includes>
-                            </artifactSet>
-                            <relocations>
-                                <relocation>
-                                    <pattern>javax.annotation</pattern>
-                                    <shadedPattern>org.apache.maven.surefire.javax.annotation</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.maven.shared</pattern>
-                                    <shadedPattern>org.apache.maven.surefire.org.apache.maven.shared</shadedPattern>
-                                </relocation>
-                            </relocations>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 </project>
diff --git a/surefire-providers/surefire-junit3/pom.xml b/surefire-providers/surefire-junit3/pom.xml
index a96cc0d..2f5a7af 100644
--- a/surefire-providers/surefire-junit3/pom.xml
+++ b/surefire-providers/surefire-junit3/pom.xml
@@ -44,35 +44,4 @@
       <version>${project.version}</version>
     </dependency>
   </dependencies>
-
-  <build>
-    <resources>
-      <resource>
-        <directory>src/main/resources/META-INF</directory>
-        <targetPath>META-INF</targetPath>
-      </resource>
-    </resources>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-shade-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-            <configuration>
-              <artifactSet>
-                <includes>
-                  <include>org.apache.maven.surefire:common-junit3</include>
-                </includes>
-              </artifactSet>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
 </project>
diff --git a/surefire-providers/surefire-junit4/pom.xml b/surefire-providers/surefire-junit4/pom.xml
index c806d37..97031dd 100644
--- a/surefire-providers/surefire-junit4/pom.xml
+++ b/surefire-providers/surefire-junit4/pom.xml
@@ -44,46 +44,4 @@
       <version>${project.version}</version>
     </dependency>
   </dependencies>
-
-  <build>
-    <resources>
-      <resource>
-        <directory>src/main/resources/META-INF</directory>
-        <targetPath>META-INF</targetPath>
-      </resource>
-    </resources>
-
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-shade-plugin</artifactId>
-        <version>1.4</version>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-            <configuration>
-              <minimizeJar>true</minimizeJar>
-              <artifactSet>
-                <includes>
-                  <include>org.apache.maven.surefire:common-junit3</include>
-                  <include>org.apache.maven.surefire:common-junit4</include>
-                  <include>org.apache.maven.surefire:common-java5</include>
-                  <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>
-    </plugins>
-  </build>
 </project>
diff --git a/surefire-providers/surefire-junit47/pom.xml b/surefire-providers/surefire-junit47/pom.xml
index 756bd9d..523abc9 100644
--- a/surefire-providers/surefire-junit47/pom.xml
+++ b/surefire-providers/surefire-junit47/pom.xml
@@ -17,158 +17,152 @@
   ~ under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
-    <groupId>org.apache.maven.surefire</groupId>
-    <artifactId>surefire-providers</artifactId>
-    <version>3.0.0-M1-SNAPSHOT</version>
-  </parent>
+    <parent>
+        <groupId>org.apache.maven.surefire</groupId>
+        <artifactId>surefire-providers</artifactId>
+        <version>3.0.0-M1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>surefire-junit47</artifactId>
+    <artifactId>surefire-junit47</artifactId>
 
-  <name>SureFire JUnitCore Runner</name>
-  <description>SureFire JUnitCore (JUnit 4.7+) Runner</description>
+    <name>SureFire JUnitCore Runner</name>
+    <description>SureFire JUnitCore (JUnit 4.7+) Runner</description>
 
-  <dependencies>
-    <dependency>
-      <groupId>com.github.stephenc.jcip</groupId>
-      <artifactId>jcip-annotations</artifactId>
-      <version>1.0-1</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.12</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.surefire</groupId>
-      <artifactId>maven-surefire-common</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.surefire</groupId>
-      <artifactId>common-junit48</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven.surefire</groupId>
+            <artifactId>common-junit48</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven.surefire</groupId>
+            <artifactId>maven-surefire-common</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.stephenc.jcip</groupId>
+            <artifactId>jcip-annotations</artifactId>
+            <version>1.0-1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
 
-  <build>
-    <resources>
-      <resource>
-        <directory>src/main/resources/META-INF</directory>
-        <targetPath>META-INF</targetPath>
-      </resource>
-    </resources>
-
-    <plugins>
-      <plugin>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>main</id>
-            <phase>process-sources</phase>
-            <goals>
-              <goal>copy</goal>
-            </goals>
-            <configuration>
-              <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
-              <overWriteIfNewer>false</overWriteIfNewer>
-              <silent>true</silent>
-              <artifactItems>
-                <artifactItem>
-                  <groupId>junit</groupId>
-                  <artifactId>junit</artifactId>
-                  <version>4.7</version>
-                  <type>jar</type>
-                </artifactItem>
-              </artifactItems>
-            </configuration>
-          </execution>
-          <execution>
-            <id>test</id>
-            <phase>process-sources</phase>
-            <goals>
-              <goal>copy</goal>
-            </goals>
-            <configuration>
-              <outputDirectory>${project.build.directory}/endorsed-test</outputDirectory>
-              <overWriteIfNewer>false</overWriteIfNewer>
-              <silent>true</silent>
-              <artifactItems>
-                <artifactItem>
-                  <groupId>junit</groupId>
-                  <artifactId>junit</artifactId>
-                  <version>4.12</version>
-                  <type>jar</type>
-                </artifactItem>
-              </artifactItems>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <compilerArguments>
-            <endorseddirs>${project.build.directory}/endorsed</endorseddirs>
-          </compilerArguments>
-          <testCompilerArguments>
-            <endorseddirs>${project.build.directory}/endorsed-test</endorseddirs>
-          </testCompilerArguments>
-        </configuration>
-      </plugin>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <redirectTestOutputToFile>true</redirectTestOutputToFile>
-          <includes>
-            <include>**/JUnit47SuiteTest.java</include>
-          </includes>
-        </configuration>
-      </plugin>
-      <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.apache.maven.surefire:common-junit3</include>
-                  <include>org.apache.maven.surefire:common-junit4</include>
-                  <include>org.apache.maven.surefire:common-java5</include>
-                </includes>
-              </artifactSet>
-              <relocations>
-                <relocation>
-                  <pattern>javax.annotation</pattern>
-                  <shadedPattern>org.apache.maven.surefire.javax.annotation</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.maven.shared</pattern>
-                  <shadedPattern>org.apache.maven.surefire.org.apache.maven.shared</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.maven.surefire.junitcore.ThreadSafe</pattern>
-                  <shadedPattern>org.junit.runner.notification.RunListener.ThreadSafe</shadedPattern>
-                  <excludes>
-                    <exclude>org.apache.maven.surefire.junitcore.ThreadSafe</exclude>
-                  </excludes>
-                </relocation>
-              </relocations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>main</id>
+                        <phase>process-sources</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>junit</groupId>
+                                    <artifactId>junit</artifactId>
+                                    <version>4.7</version>
+                                    <type>jar</type>
+                                    <overWrite>true</overWrite>
+                                    <outputDirectory>${project.build.directory}/endorsed-tmp</outputDirectory>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>main-junit47-patch</id>
+                        <phase>process-sources</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>junit</groupId>
+                                    <artifactId>junit</artifactId>
+                                    <version>4.12</version>
+                                    <type>jar</type>
+                                    <overWrite>true</overWrite>
+                                    <outputDirectory>${project.build.directory}/endorsed-tmp</outputDirectory>
+                                    <includes>org/junit/runner/notification/RunListener*</includes>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>test</id>
+                        <phase>process-test-sources</phase>
+                        <goals>
+                            <goal>copy</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/endorsed-test</outputDirectory>
+                            <overWriteIfNewer>false</overWriteIfNewer>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>junit</groupId>
+                                    <artifactId>junit</artifactId>
+                                    <version>4.12</version>
+                                    <type>jar</type>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>patch-junit47</id>
+                        <phase>process-sources</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <attach>false</attach>
+                            <finalName>junit-4.7</finalName>
+                            <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
+                            <descriptors>
+                                <descriptor>src/assembly/assembly.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArguments>
+                        <endorseddirs>${project.build.directory}/endorsed</endorseddirs>
+                    </compilerArguments>
+                    <testCompilerArguments>
+                        <endorseddirs>${project.build.directory}/endorsed-test</endorseddirs>
+                    </testCompilerArguments>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    <includes>
+                        <include>**/JUnit47SuiteTest.java</include>
+                    </includes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/surefire-providers/surefire-junit47/src/assembly/assembly.xml b/surefire-providers/surefire-junit47/src/assembly/assembly.xml
new file mode 100644
index 0000000..7556763
--- /dev/null
+++ b/surefire-providers/surefire-junit47/src/assembly/assembly.xml
@@ -0,0 +1,35 @@
+<!--
+  ~ 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.
+  -->
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+    <id>with-threadsafe-listener</id>
+    <formats>
+        <format>jar</format>
+    </formats>
+    <baseDirectory>target/endorsed-tmp</baseDirectory>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <fileSets>
+        <fileSet>
+            <useDefaultExcludes>true</useDefaultExcludes>
+            <directory>${project.build.directory}/endorsed-tmp</directory>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ClassesParallelRunListener.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ClassesParallelRunListener.java
index 52a7ffb..a0ab985 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ClassesParallelRunListener.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ClassesParallelRunListener.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import org.apache.maven.surefire.report.ConsoleStream;
 import org.apache.maven.surefire.report.ReporterFactory;
 import org.apache.maven.surefire.testset.TestSetFailedException;
+import org.junit.runner.notification.RunListener.ThreadSafe;
 
 /**
  * @author Kristian Rosenvold
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/MethodsParallelRunListener.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/MethodsParallelRunListener.java
index b478670..21dd9ed 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/MethodsParallelRunListener.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/MethodsParallelRunListener.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import org.apache.maven.surefire.report.ConsoleStream;
 import org.apache.maven.surefire.report.ReporterFactory;
 import org.apache.maven.surefire.testset.TestSetFailedException;
+import org.junit.runner.notification.RunListener.ThreadSafe;
 
 /**
  * @author Kristian Rosenvold
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ThreadSafe.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ThreadSafe.java
deleted file mode 100644
index 2eaf90a..0000000
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ThreadSafe.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.maven.surefire.junitcore;
-
-/*
- * 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.
- */
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * After compiling sources under endorsed junit:4.7, this annotation
- * is relocated in org.junit.runner.notification.RunListener.ThreadSafe.
- */
-@Documented
-@Target( ElementType.TYPE )
-@Retention( RetentionPolicy.RUNTIME )
-@interface ThreadSafe
-{
-}
diff --git a/surefire-providers/surefire-testng-utils/pom.xml b/surefire-providers/surefire-testng-utils/pom.xml
index 3a812a9..aa6e221 100644
--- a/surefire-providers/surefire-testng-utils/pom.xml
+++ b/surefire-providers/surefire-testng-utils/pom.xml
@@ -39,12 +39,9 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-shared-utils</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-grouper</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.testng</groupId>
@@ -58,32 +55,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.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>
         <dependencies>
           <dependency>
diff --git a/surefire-providers/surefire-testng/pom.xml b/surefire-providers/surefire-testng/pom.xml
index 9c28f13..78ebae1 100644
--- a/surefire-providers/surefire-testng/pom.xml
+++ b/surefire-providers/surefire-testng/pom.xml
@@ -58,12 +58,6 @@
   </dependencies>
 
   <build>
-    <resources>
-      <resource>
-        <directory>src/main/resources/META-INF</directory>
-        <targetPath>META-INF</targetPath>
-      </resource>
-    </resources>
     <plugins>
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
diff --git a/surefire-report-parser/pom.xml b/surefire-report-parser/pom.xml
index 944dad0..cd99305 100644
--- a/surefire-report-parser/pom.xml
+++ b/surefire-report-parser/pom.xml
@@ -33,13 +33,14 @@
   <description>Parses report output files from surefire.</description>
 
   <prerequisites>
-    <maven>2.2.1</maven>
+    <maven>3.0</maven>
   </prerequisites>
 
   <dependencies>
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-logger-api</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
@@ -68,8 +69,6 @@
         </configuration>
       </plugin>
       <plugin>
-        <!-- Do we need shading here ?? -->
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
         <executions>
           <execution>
@@ -87,7 +86,7 @@
               <relocations>
                 <relocation>
                   <pattern>org.apache.maven.shared</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
+                  <shadedPattern>org.apache.maven.surefire.shade.report.org.apache.maven.shared</shadedPattern>
                 </relocation>
               </relocations>
             </configuration>
diff --git a/surefire-shadefire/pom.xml b/surefire-shadefire/pom.xml
index f4790a1..b795c08 100644
--- a/surefire-shadefire/pom.xml
+++ b/surefire-shadefire/pom.xml
@@ -63,9 +63,7 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
-        <version>1.4</version>
         <executions>
           <execution>
             <phase>package</phase>
@@ -73,7 +71,6 @@
               <goal>shade</goal>
             </goals>
             <configuration>
-              <!-- minimizeJar>true</minimizeJar -->
               <artifactSet>
                 <includes>
                   <include>org.apache.maven.surefire:surefire-api</include>


Mime
View raw message