You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2019/12/23 01:38:26 UTC

[maven-surefire] branch cli updated (e283b8d -> cfd19ab)

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

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


 discard e283b8d  investigating IT 735
 discard 559b904  investigating IT 735
 discard d9ff10a  investigating IT 735
 discard 0571f67  investigating IT 735
 discard 5582564  investigating IT 735
 discard 41546ff  investigating IT 735
 discard 6b5d6ce  investigating IT 735
 discard f787544  investigating IT 735
 discard 9b64eca  investigating IT 735
 discard 5faf3fc  investigating IT 735
 discard f9edb07  investigating IT 735
 discard 7c08750  investigating IT 735
 discard 6033e89  investigating IT 735
 discard e036e4c  investigating IT 735
 discard 053ea66  investigating IT 735
 discard ac182cc  investigating IT 735
 discard 5ecaf91  in case the JVM prins the error to the std/out
 discard c44bed9  investigating IT 735
 discard 7ab22e2  close every stream if isSaidGoodBye=true, otherwise close it in stream's thread
 discard 3e49161  experimenting with failed tests
 discard c04bb6d  fixed NPE with non-threadsafe java.util.Scanner
 discard a6c6130  substitutes the old call executeCommandLineAsCallable() - (process call with all stream handlers)
 discard 26caa99  CommandlineExecutor with java.nio.channels.Channel used in Pipes and TCP ServerSocketChannel (instead of maven-shared-utils)
 discard 65c7afd  used surefire-shared-utils instead of shaded artifacts with duplicates in many modules
     new 4a52363  [SUREFIRE-1740] Prerequisite implementation for SUREFIRE-1658
     new cfd19ab  running all build

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

 * -- * -- B -- O -- O -- O   (e283b8d)
            \
             N -- N -- N   refs/heads/cli (cfd19ab)

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

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

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


Summary of changes:
 surefire-its/pom.xml                                               | 7 +++----
 .../its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java  | 2 --
 2 files changed, 3 insertions(+), 6 deletions(-)


[maven-surefire] 02/02: running all build

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

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

commit cfd19ab7c44e664f5acb1e118eddcfffce4d0a3e
Author: tibordigana <ti...@apache.org>
AuthorDate: Mon Dec 23 02:37:45 2019 +0100

    running all build
---
 surefire-its/pom.xml                                               | 7 +++----
 .../its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java  | 2 --
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml
index 05e50a2..a49244f 100644
--- a/surefire-its/pom.xml
+++ b/surefire-its/pom.xml
@@ -167,8 +167,7 @@
                 <artifactId>maven-failsafe-plugin</artifactId>
                 <version>3.0.0-M4</version> <!-- ${shadedVersion}, but resolved due to https://issues.apache.org/jira/browse/MRELEASE-799 -->
                 <configuration>
-                    <skipITs>false</skipITs>
-                    <skipTests>false</skipTests>
+                    <skipTests>${skipTests}</skipTests>
                     <jvm>${jdk.home}/bin/java</jvm>
                     <runOrder>alphabetical</runOrder>
                     <threadCount>1</threadCount>
@@ -176,7 +175,7 @@
                     <forkMode>once</forkMode>
                     <argLine>-server -Xmx64m -XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true -Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
                     <includes>
-                        <include>org/apache/**/Surefire735ForkFailWithRedirectConsoleOutputIT.java</include>
+                        <include>org/apache/**/*IT*.java</include>
                     </includes>
                     <!-- Pass current surefire version to the main suite so that it -->
                     <!-- can forward to all integration test projects. SUREFIRE-513 -->
@@ -193,7 +192,7 @@
                         <!-- see the f/w com.googlecode.junit-toolbox:junit-toolbox -->
                         <maxParallelTestThreads>3</maxParallelTestThreads>
                     </systemPropertyVariables>
-<!--                    <redirectTestOutputToFile>true</redirectTestOutputToFile>-->
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                 </configuration>
                 <dependencies>
                     <dependency>
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java
index 81d80ea..ff5d14a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java
@@ -39,7 +39,6 @@ public class Surefire735ForkFailWithRedirectConsoleOutputIT
     @Test
     public void vmStartFail()
     {
-        System.out.println( "verifier.forkMode=" + System.getProperty( "verifier.forkMode" ) );
         OutputValidator outputValidator = unpack().failNever().executeTest();
         assertJvmCrashed( outputValidator );
     }
@@ -47,7 +46,6 @@ public class Surefire735ForkFailWithRedirectConsoleOutputIT
     @Test
     public void vmStartFailShouldFailBuildk()
     {
-        System.out.println( "verifier.forkMode=" + System.getProperty( "verifier.forkMode" ) );
         OutputValidator outputValidator = unpack().maven().withFailure().executeTest();
         assertJvmCrashed( outputValidator );
     }


[maven-surefire] 01/02: [SUREFIRE-1740] Prerequisite implementation for SUREFIRE-1658

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

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

commit 4a52363bfb124de20dbb95708586d8d0a29e9f47
Author: tibordigana <ti...@apache.org>
AuthorDate: Thu Nov 21 02:07:16 2019 +0100

    [SUREFIRE-1740] Prerequisite implementation for SUREFIRE-1658
---
 maven-failsafe-plugin/pom.xml                      |  48 +-------
 .../apache/maven/plugin/failsafe/VerifyMojo.java   |   2 +-
 .../failsafe/util/FailsafeSummaryXmlUtils.java     |   6 +-
 maven-surefire-common/pom.xml                      |  40 +------
 .../plugin/surefire/AbstractSurefireMojo.java      |  16 +--
 .../surefire/StartupReportConfiguration.java       |   2 +-
 .../maven/plugin/surefire/SurefireHelper.java      |   2 +-
 .../maven/plugin/surefire/TestClassPath.java       |   2 +-
 .../booterclient/ClasspathForkConfiguration.java   |   2 +-
 .../plugin/surefire/booterclient/ForkStarter.java  |  80 ++++++++++---
 .../booterclient/JarManifestForkConfiguration.java |   6 +-
 .../ModularClasspathForkConfiguration.java         |   2 +-
 .../OutputStreamFlushableCommandline.java          |   6 +-
 .../surefire/booterclient/output/ForkClient.java   |   2 +-
 .../output/NativeStdErrStreamConsumer.java         |   2 +-
 .../output/ThreadedStreamConsumer.java             |  11 +-
 .../plugin/surefire/report/ConsoleReporter.java    |   4 +-
 .../surefire/report/DefaultReporterFactory.java    |   4 +-
 .../plugin/surefire/report/FileReporterUtils.java  |   2 +-
 .../surefire/report/StatelessXmlReporter.java      |   4 +-
 .../maven/plugin/surefire/report/TestSetStats.java |   4 +-
 .../Utf8RecodingDeferredFileOutputStream.java      |   2 +-
 .../maven/plugin/surefire/util/ScannerUtil.java    |   2 +-
 .../plugin/surefire/util/SpecificFileFilter.java   |   2 +-
 .../plugin/surefire/AbstractSurefireMojoTest.java  |   2 +-
 .../maven/plugin/surefire/SurefireHelperTest.java  |   2 +-
 ...ooterDeserializerProviderConfigurationTest.java |   2 +-
 ...BooterDeserializerStartupConfigurationTest.java |   2 +-
 .../booterclient/ForkConfigurationTest.java        |   8 +-
 .../ModularClasspathForkConfigurationTest.java     |   2 +-
 .../OutputStreamFlushableCommandlineTest.java      |   4 +-
 .../report/DefaultReporterFactoryTest.java         |   4 +-
 .../surefire/report/StatelessXmlReporterTest.java  |   6 +-
 .../plugin/surefire/report/TestSetStatsTest.java   |   2 +-
 .../runorder/RunEntryStatisticsMapTest.java        |   2 +-
 .../StatelessTestsetInfoReporterTest.java          |   2 +-
 .../report/ConsoleOutputFileReporterTest.java      |   2 +-
 surefire-api/pom.xml                               |  39 +------
 .../maven/surefire/SpecificTestClassFilter.java    |   2 +-
 .../surefire/booter/ForkedChannelEncoder.java      |   2 +-
 .../maven/surefire/cli/CommandLineOption.java      |  10 --
 .../maven/surefire/testset/ResolvedTest.java       |  14 +--
 .../maven/surefire/testset/TestListResolver.java   |  10 +-
 .../surefire/util/DefaultDirectoryScanner.java     |   4 +-
 .../surefire/booter/ForkedChannelEncoderTest.java  |   2 +-
 .../surefire/booter/NewClassLoaderRunner.java      |   2 +-
 surefire-booter/pom.xml                            |  54 ---------
 .../apache/maven/surefire/booter/PpidChecker.java  |  12 +-
 .../apache/maven/surefire/booter/SystemUtils.java  |  12 +-
 .../maven/surefire/booter/ForkedBooterTest.java    |   4 +-
 .../maven/surefire/booter/PpidCheckerTest.java     |   4 +-
 .../maven/surefire/booter/SystemUtilsTest.java     |  12 +-
 surefire-extensions-api/pom.xml                    |   5 +
 .../extensions/util/CommandlineExecutor.java       | 128 +++++++++++++++++++++
 .../extensions/util/CommandlineStreams.java        |  82 +++++++++++++
 .../extensions/util/CountdownCloseable.java        |  45 ++++----
 .../util/FlushableWritableByteChannel.java         |  68 +++++++++++
 .../extensions/util/LineConsumerThread.java        | 101 ++++++++++++++++
 .../surefire/extensions/util/StreamFeeder.java     |  89 ++++++++++++++
 surefire-its/pom.xml                               |   7 +-
 ...fire735ForkFailWithRedirectConsoleOutputIT.java |   7 +-
 surefire-providers/common-java5/pom.xml            |  30 +----
 .../surefire/report/SmartStackTraceParser.java     |   6 +-
 surefire-report-parser/pom.xml                     |  30 +----
 .../plugins/surefire/report/ReportTestCase.java    |   2 +-
 .../surefire/report/SurefireReportParser.java      |   4 +-
 .../surefire/report/TestSuiteXmlParser.java        |   2 +-
 67 files changed, 697 insertions(+), 385 deletions(-)

diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
index ab583ff..915d47e 100644
--- a/maven-failsafe-plugin/pom.xml
+++ b/maven-failsafe-plugin/pom.xml
@@ -70,16 +70,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.maven.shared</groupId>
-            <artifactId>maven-shared-utils</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
+            <groupId>org.apache.maven.surefire</groupId>
+            <artifactId>surefire-shared-utils</artifactId>
+            <version>3.0.0-M4</version>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
@@ -216,41 +209,6 @@
                     <siteDirectory>${project.build.directory}/source-site</siteDirectory>
                 </configuration>
             </plugin>
-            <plugin>
-                <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>
-                                    <include>commons-io:commons-io</include>
-                                    <include>org.apache.commons:commons-lang3</include>
-                                </includes>
-                            </artifactSet>
-                            <relocations>
-                                <relocation>
-                                    <pattern>org.apache.maven.shared.utils</pattern>
-                                    <shadedPattern>org.apache.maven.surefire.shade.failsafe.org.apache.maven.shared.utils</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.commons.io</pattern>
-                                    <shadedPattern>org.apache.maven.surefire.shade.failsafe.org.apache.commons.io</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.commons.lang3</pattern>
-                                    <shadedPattern>org.apache.maven.surefire.shade.failsafe.org.apache.commons.lang3</shadedPattern>
-                                </relocation>
-                            </relocations>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
 
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 dbb6b7e..2fa31e1 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
@@ -39,7 +39,7 @@ import java.io.File;
 import java.util.Collection;
 
 import static org.apache.maven.plugin.surefire.SurefireHelper.reportExecution;
-import static org.apache.maven.shared.utils.StringUtils.capitalizeFirstLetter;
+import static org.apache.maven.surefire.shared.utils.StringUtils.capitalizeFirstLetter;
 import static org.apache.maven.surefire.suite.RunResult.noTestsRun;
 
 /**
diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java
index 6035308..f7c9cef 100644
--- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java
+++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java
@@ -19,7 +19,7 @@ package org.apache.maven.plugin.failsafe.util;
  * under the License.
  */
 
-import org.apache.commons.io.IOUtils;
+import org.apache.maven.surefire.shared.io.IOUtils;
 import org.apache.maven.surefire.suite.RunResult;
 import org.w3c.dom.Node;
 import org.xml.sax.InputSource;
@@ -37,8 +37,8 @@ import static java.lang.Boolean.parseBoolean;
 import static java.lang.Integer.parseInt;
 import static java.lang.String.format;
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.commons.lang3.StringEscapeUtils.escapeXml10;
-import static org.apache.commons.lang3.StringEscapeUtils.unescapeXml;
+import static org.apache.maven.surefire.shared.lang3.StringEscapeUtils.escapeXml10;
+import static org.apache.maven.surefire.shared.lang3.StringEscapeUtils.unescapeXml;
 import static org.apache.maven.surefire.util.internal.StringUtils.isBlank;
 
 /**
diff --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
index 10c1982..fefe831 100644
--- a/maven-surefire-common/pom.xml
+++ b/maven-surefire-common/pom.xml
@@ -80,20 +80,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.maven.shared</groupId>
-            <artifactId>maven-shared-utils</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-compress</artifactId>
+            <groupId>org.apache.maven.surefire</groupId>
+            <artifactId>surefire-shared-utils</artifactId>
+            <version>3.0.0-M4</version>
         </dependency>
         <dependency>
             <groupId>com.google.code.findbugs</groupId>
@@ -187,7 +176,6 @@
                 <artifactId>maven-shade-plugin</artifactId>
                 <executions>
                     <execution>
-                        <phase>package</phase>
                         <goals>
                             <goal>shade</goal>
                         </goals>
@@ -195,31 +183,9 @@
                             <minimizeJar>true</minimizeJar>
                             <artifactSet>
                                 <includes>
-                                    <include>org.apache.maven.shared:maven-shared-utils</include>
                                     <include>org.apache.maven.shared:maven-common-artifact-filters</include>
-                                    <include>commons-io:commons-io</include>
-                                    <include>org.apache.commons:commons-lang3</include>
-                                    <include>org.apache.commons:commons-compress</include>
                                 </includes>
                             </artifactSet>
-                            <relocations>
-                                <relocation>
-                                    <pattern>org.apache.maven.shared.utils</pattern>
-                                    <shadedPattern>org.apache.maven.surefire.shade.common.org.apache.maven.shared.utils</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.commons.io</pattern>
-                                    <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.common.org.apache.commons.lang3</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.commons.compress</pattern>
-                                    <shadedPattern>org.apache.maven.surefire.shade.common.org.apache.commons.compress</shadedPattern>
-                                </relocation>
-                            </relocations>
                         </configuration>
                     </execution>
                 </executions>
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 75f6241..7604c03 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
@@ -58,7 +58,7 @@ import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
 import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver;
-import org.apache.maven.shared.utils.io.FileUtils;
+import org.apache.maven.surefire.shared.utils.io.FileUtils;
 import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
 import org.apache.maven.surefire.booter.Classpath;
 import org.apache.maven.surefire.booter.ClasspathConfiguration;
@@ -120,17 +120,17 @@ import static java.util.Arrays.asList;
 import static java.util.Collections.addAll;
 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.surefire.shared.lang3.StringUtils.substringBeforeLast;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
 import static org.apache.maven.artifact.ArtifactUtils.artifactMapByVersionlessId;
 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;
-import static org.apache.maven.shared.utils.StringUtils.isEmpty;
-import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
-import static org.apache.maven.shared.utils.StringUtils.isNotEmpty;
-import static org.apache.maven.shared.utils.StringUtils.split;
+import static org.apache.maven.surefire.shared.utils.StringUtils.capitalizeFirstLetter;
+import static org.apache.maven.surefire.shared.utils.StringUtils.isEmpty;
+import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
+import static org.apache.maven.surefire.shared.utils.StringUtils.isNotEmpty;
+import static org.apache.maven.surefire.shared.utils.StringUtils.split;
 import static org.apache.maven.surefire.booter.SystemUtils.JAVA_SPECIFICATION_VERSION;
 import static org.apache.maven.surefire.booter.SystemUtils.endsWithJavaPath;
 import static org.apache.maven.surefire.booter.SystemUtils.isBuiltInJava9AtLeast;
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
index 02ec44b..a15f802 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
@@ -41,7 +41,7 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.commons.lang3.StringUtils.trimToNull;
+import static org.apache.maven.surefire.shared.lang3.StringUtils.trimToNull;
 import static org.apache.maven.plugin.surefire.SurefireHelper.replaceForkThreadsInPath;
 import static org.apache.maven.plugin.surefire.report.ConsoleReporter.BRIEF;
 import static org.apache.maven.plugin.surefire.report.ConsoleReporter.PLAIN;
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 9f6e2d7..bb40574 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
@@ -38,7 +38,7 @@ import java.util.LinkedList;
 import java.util.List;
 
 import static java.util.Collections.unmodifiableList;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
 import static org.apache.maven.surefire.booter.DumpErrorSingleton.DUMPSTREAM_FILE_EXT;
 import static org.apache.maven.surefire.booter.DumpErrorSingleton.DUMP_FILE_EXT;
 import static org.apache.maven.surefire.cli.CommandLineOption.LOGGING_LEVEL_DEBUG;
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/TestClassPath.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/TestClassPath.java
index 3a37816..ba73361 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/TestClassPath.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/TestClassPath.java
@@ -29,7 +29,7 @@ import java.util.List;
 import java.util.Map;
 
 import static java.util.Collections.addAll;
-import static org.apache.maven.shared.utils.StringUtils.split;
+import static org.apache.maven.surefire.shared.utils.StringUtils.split;
 
 final class TestClassPath
 {
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ClasspathForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ClasspathForkConfiguration.java
index 72aab98..1ca3932 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ClasspathForkConfiguration.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ClasspathForkConfiguration.java
@@ -31,7 +31,7 @@ import java.io.File;
 import java.util.Map;
 import java.util.Properties;
 
-import static org.apache.maven.shared.utils.StringUtils.join;
+import static org.apache.maven.surefire.shared.utils.StringUtils.join;
 
 /**
  * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
index 2570977..a0c0183 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
@@ -33,8 +33,12 @@ import org.apache.maven.plugin.surefire.booterclient.output.NativeStdErrStreamCo
 import org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer;
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
 import org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
-import org.apache.maven.shared.utils.cli.CommandLineCallable;
-import org.apache.maven.shared.utils.cli.CommandLineException;
+import org.apache.maven.surefire.extensions.util.CommandlineExecutor;
+import org.apache.maven.surefire.extensions.util.CommandlineStreams;
+import org.apache.maven.surefire.extensions.util.CountdownCloseable;
+import org.apache.maven.surefire.extensions.util.LineConsumerThread;
+import org.apache.maven.surefire.extensions.util.StreamFeeder;
+import org.apache.maven.surefire.shared.utils.cli.CommandLineException;
 import org.apache.maven.surefire.booter.AbstractPathConfiguration;
 import org.apache.maven.surefire.booter.KeyValueSource;
 import org.apache.maven.surefire.booter.PropertiesWrapper;
@@ -75,7 +79,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import static java.lang.StrictMath.min;
 import static java.lang.System.currentTimeMillis;
 import static java.lang.Thread.currentThread;
-import static java.nio.charset.StandardCharsets.ISO_8859_1;
 import static java.util.Collections.addAll;
 import static java.util.Objects.requireNonNull;
 import static java.util.concurrent.Executors.newScheduledThreadPool;
@@ -88,9 +91,8 @@ import static org.apache.maven.plugin.surefire.booterclient.ForkNumberBucket.dra
 import static org.apache.maven.plugin.surefire.booterclient.ForkNumberBucket.returnNumber;
 import static org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStream
                       .TestLessInputStreamBuilder;
-import static org.apache.maven.shared.utils.cli.CommandLineUtils.executeCommandLineAsCallable;
-import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
-import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.removeShutdownHook;
+import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
+import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.removeShutdownHook;
 import static org.apache.maven.surefire.booter.SystemPropertyManager.writePropertiesFile;
 import static org.apache.maven.surefire.cli.CommandLineOption.SHOW_ERRORS;
 import static org.apache.maven.surefire.suite.RunResult.SUCCESS;
@@ -212,11 +214,22 @@ public class ForkStarter
         public void close()
         {
             run();
+            reset();
+        }
+
+        void reset()
+        {
+            testProvidingInputStream.clear();
             if ( inputStreamCloserHook != null )
             {
                 removeShutdownHook( inputStreamCloserHook );
             }
         }
+
+        void addCloseable( Closeable closeable )
+        {
+            testProvidingInputStream.add( closeable );
+        }
     }
 
     public ForkStarter( ProviderConfiguration providerConfiguration, StartupConfiguration startupConfiguration,
@@ -603,29 +616,51 @@ public class ForkStarter
         Integer result = null;
         RunResult runResult = null;
         SurefireBooterForkException booterForkException = null;
+        StreamFeeder in = null;
+        LineConsumerThread out = null;
+        LineConsumerThread err = null;
         try
         {
             NativeStdErrStreamConsumer stdErrConsumer =
                     new NativeStdErrStreamConsumer( forkClient.getDefaultReporterFactory() );
-
-            CommandLineCallable future =
-                    executeCommandLineAsCallable( cli, testProvidingInputStream, threadedStreamConsumer,
-                                                        stdErrConsumer, 0, closer, ISO_8859_1 );
-
             currentForkClients.add( forkClient );
 
-            result = future.call();
+            // default impl of the extension - solves everything including the encoder/decoder, Process starter,
+            // adaptation of the streams to pipes and sockets
+            // non-default impl may use another classes and not the LineConsumerThread, StreamFeeder - freedom
+            // BEGIN: beginning of the call of the extension
+            CountdownCloseable countdownCloseable = new CountdownCloseable( threadedStreamConsumer, 2 );
+            CommandlineExecutor exec = new CommandlineExecutor( cli, countdownCloseable );
+            CommandlineStreams streams = exec.execute();
+            closer.addCloseable( streams );
+            in = new StreamFeeder( "std-in-fork-" + forkNumber, streams.getStdInChannel(), testProvidingInputStream );
+            in.start();
+            out = new LineConsumerThread( "std-out-fork-" + forkNumber, streams.getStdOutChannel(),
+                                          threadedStreamConsumer, countdownCloseable );
+            out.start();
+            err = new LineConsumerThread( "std-err-fork-" + forkNumber, streams.getStdErrChannel(),
+                                          stdErrConsumer, countdownCloseable );
+            err.start();
+            result = exec.awaitExit();
+            // END: end of the call of the extension
 
             if ( forkClient.hadTimeout() )
             {
                 runResult = timeout( forkClient.getDefaultReporterFactory().getGlobalRunStatistics().getRunResult() );
             }
-            else if ( result == null || result != SUCCESS )
+            else if ( result != SUCCESS )
             {
                 booterForkException =
                         new SurefireBooterForkException( "Error occurred in starting fork, check output in log" );
             }
         }
+        catch ( InterruptedException e )
+        {
+            // maybe implement it in the Future.cancel() of the extension or similar
+            in.disable();
+            out.disable();
+            err.disable();
+        }
         catch ( CommandLineException e )
         {
             runResult = failure( forkClient.getDefaultReporterFactory().getGlobalRunStatistics().getRunResult(), e );
@@ -637,7 +672,24 @@ public class ForkStarter
         finally
         {
             currentForkClients.remove( forkClient );
-            closer.close();
+            if ( forkClient.isSaidGoodBye() )
+            {
+                closer.close();
+            }
+            else
+            {
+                try ( Closeable c1 = testProvidingInputStream;
+                      Closeable c2 = in )
+                {
+                    closer.reset();
+                }
+                catch ( IOException e )
+                {
+                    InPluginProcessDumpSingleton.getSingleton()
+                        .dumpException( e, e.getLocalizedMessage(), dumpLogDir, forkNumber );
+                }
+            }
+
             if ( runResult == null )
             {
                 runResult = forkClient.getDefaultReporterFactory().getGlobalRunStatistics().getRunResult();
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java
index 78e915a..02c275c 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java
@@ -19,9 +19,9 @@ package org.apache.maven.plugin.surefire.booterclient;
  * under the License.
  */
 
-import org.apache.commons.compress.archivers.zip.Zip64Mode;
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
-import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
+import org.apache.maven.surefire.shared.compress.archivers.zip.Zip64Mode;
+import org.apache.maven.surefire.shared.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.maven.surefire.shared.compress.archivers.zip.ZipArchiveOutputStream;
 import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline;
 import org.apache.maven.plugin.surefire.booterclient.output.InPluginProcessDumpSingleton;
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfiguration.java
index af38bc5..8f5030b 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfiguration.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfiguration.java
@@ -44,7 +44,7 @@ import java.util.Properties;
 import static java.io.File.createTempFile;
 import static java.io.File.pathSeparatorChar;
 import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath;
-import static org.apache.maven.shared.utils.StringUtils.replace;
+import static org.apache.maven.surefire.shared.utils.StringUtils.replace;
 import static org.apache.maven.surefire.util.internal.StringUtils.NL;
 
 /**
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java
index e22b8df..7f14c54 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java
@@ -24,9 +24,9 @@ import java.util.Collections;
 import java.util.Properties;
 import java.util.concurrent.ConcurrentLinkedDeque;
 
-import org.apache.maven.shared.utils.cli.CommandLineException;
-import org.apache.maven.shared.utils.cli.CommandLineUtils;
-import org.apache.maven.shared.utils.cli.Commandline;
+import org.apache.maven.surefire.shared.utils.cli.CommandLineException;
+import org.apache.maven.surefire.shared.utils.cli.CommandLineUtils;
+import org.apache.maven.surefire.shared.utils.cli.Commandline;
 
 /**
  * A {@link Commandline} implementation that provides the output stream of
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
index f2a934f..86ad955 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
@@ -22,7 +22,7 @@ package org.apache.maven.plugin.surefire.booterclient.output;
 import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.NotifiableTestStream;
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
 import org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
-import org.apache.maven.shared.utils.cli.StreamConsumer;
+import org.apache.maven.surefire.shared.utils.cli.StreamConsumer;
 import org.apache.maven.surefire.report.ConsoleOutputReceiver;
 import org.apache.maven.surefire.report.ReportEntry;
 import org.apache.maven.surefire.report.RunListener;
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/NativeStdErrStreamConsumer.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/NativeStdErrStreamConsumer.java
index ace4f8a..b17bfe4 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/NativeStdErrStreamConsumer.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/NativeStdErrStreamConsumer.java
@@ -20,7 +20,7 @@ package org.apache.maven.plugin.surefire.booterclient.output;
  */
 
 import org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
-import org.apache.maven.shared.utils.cli.StreamConsumer;
+import org.apache.maven.surefire.shared.utils.cli.StreamConsumer;
 
 /**
  * Used by forked JMV, see {@link org.apache.maven.plugin.surefire.booterclient.ForkStarter}.
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
index 388f16d..853d35c 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
@@ -19,7 +19,7 @@ package org.apache.maven.plugin.surefire.booterclient.output;
  * under the License.
  */
 
-import org.apache.maven.shared.utils.cli.StreamConsumer;
+import org.apache.maven.surefire.shared.utils.cli.StreamConsumer;
 import org.apache.maven.surefire.util.internal.DaemonThreadFactory;
 
 import java.io.Closeable;
@@ -76,7 +76,7 @@ public final class ThreadedStreamConsumer
         @Override
         public void run()
         {
-            while ( !ThreadedStreamConsumer.this.stop.get() )
+            while ( !ThreadedStreamConsumer.this.stop.get() || !ThreadedStreamConsumer.this.items.isEmpty() )
             {
                 try
                 {
@@ -115,7 +115,11 @@ public final class ThreadedStreamConsumer
     @Override
     public void consumeLine( String s )
     {
-        if ( stop.get() && !thread.isAlive() )
+        if ( stop.get() )
+        {
+            return;
+        }
+        else if ( !thread.isAlive() )
         {
             items.clear();
             return;
@@ -138,7 +142,6 @@ public final class ThreadedStreamConsumer
     {
         if ( stop.compareAndSet( false, true ) )
         {
-            items.clear();
             try
             {
                 items.put( END_ITEM );
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
index 0bee687..e51c9db 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
@@ -22,14 +22,14 @@ package org.apache.maven.plugin.surefire.report;
 import java.util.List;
 
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
-import org.apache.maven.shared.utils.logging.MessageBuilder;
+import org.apache.maven.surefire.shared.utils.logging.MessageBuilder;
 import org.apache.maven.plugin.surefire.log.api.Level;
 import org.apache.maven.surefire.extensions.StatelessTestsetInfoConsoleReportEventListener;
 import org.apache.maven.surefire.report.TestSetReportEntry;
 
 import static org.apache.maven.plugin.surefire.log.api.Level.resolveLevel;
 import static org.apache.maven.plugin.surefire.report.TestSetStats.concatenateWithTestGroup;
-import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+import static org.apache.maven.surefire.shared.utils.logging.MessageUtils.buffer;
 
 /**
  * Base class for console reporters.
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 ed93a65..7007695 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
@@ -23,7 +23,7 @@ import org.apache.maven.plugin.surefire.StartupReportConfiguration;
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
 import org.apache.maven.plugin.surefire.log.api.Level;
 import org.apache.maven.plugin.surefire.runorder.StatisticsReporter;
-import org.apache.maven.shared.utils.logging.MessageBuilder;
+import org.apache.maven.surefire.shared.utils.logging.MessageBuilder;
 import org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener;
 import org.apache.maven.surefire.extensions.StatelessReportEventListener;
 import org.apache.maven.surefire.extensions.StatelessTestsetInfoConsoleReportEventListener;
@@ -54,7 +54,7 @@ import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.Tes
 import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR;
 import static org.apache.maven.plugin.surefire.report.ReportEntryType.FAILURE;
 import static org.apache.maven.plugin.surefire.report.ReportEntryType.SUCCESS;
-import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+import static org.apache.maven.surefire.shared.utils.logging.MessageUtils.buffer;
 import static org.apache.maven.surefire.util.internal.ObjectUtils.useNonNull;
 
 /**
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporterUtils.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporterUtils.java
index fd33d8e..31d1904 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporterUtils.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporterUtils.java
@@ -19,7 +19,7 @@ package org.apache.maven.plugin.surefire.report;
  * under the License.
  */
 
-import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
 
 /**
  * Utils class for file-based reporters
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 fcb066e..d537d2c 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
@@ -20,8 +20,8 @@ package org.apache.maven.plugin.surefire.report;
  */
 
 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.shared.utils.xml.PrettyPrintXMLWriter;
+import org.apache.maven.surefire.shared.utils.xml.XMLWriter;
 import org.apache.maven.surefire.extensions.StatelessReportEventListener;
 import org.apache.maven.surefire.report.ReporterException;
 import org.apache.maven.surefire.report.SafeThrowable;
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetStats.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetStats.java
index 3e360c1..b34a25f 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetStats.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetStats.java
@@ -19,7 +19,7 @@ package org.apache.maven.plugin.surefire.report;
  * under the License.
  */
 
-import org.apache.maven.shared.utils.logging.MessageBuilder;
+import org.apache.maven.surefire.shared.utils.logging.MessageBuilder;
 import org.apache.maven.surefire.report.ReportEntry;
 
 import java.util.ArrayList;
@@ -28,7 +28,7 @@ import java.util.List;
 import java.util.Queue;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
-import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+import static org.apache.maven.surefire.shared.utils.logging.MessageUtils.buffer;
 import static org.apache.maven.surefire.report.CategorizedReportEntry.GROUP_PREFIX;
 
 /**
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/Utf8RecodingDeferredFileOutputStream.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/Utf8RecodingDeferredFileOutputStream.java
index c3eda01..948f131 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/Utf8RecodingDeferredFileOutputStream.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/Utf8RecodingDeferredFileOutputStream.java
@@ -19,7 +19,7 @@ package org.apache.maven.plugin.surefire.report;
  * under the License.
  */
 
-import org.apache.commons.io.output.DeferredFileOutputStream;
+import org.apache.maven.surefire.shared.io.output.DeferredFileOutputStream;
 
 import java.io.IOException;
 import java.io.OutputStream;
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java
index 8073907..afd9cf2 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java
@@ -19,7 +19,7 @@ package org.apache.maven.plugin.surefire.util;
  * under the License.
  */
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.maven.surefire.shared.lang3.StringUtils;
 import javax.annotation.Nonnull;
 
 final class ScannerUtil
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/SpecificFileFilter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/SpecificFileFilter.java
index 6b97b2f..00ea599 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/SpecificFileFilter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/SpecificFileFilter.java
@@ -24,7 +24,7 @@ import java.util.Set;
 
 import javax.annotation.Nullable;
 
-import org.apache.maven.shared.utils.io.SelectorUtils;
+import org.apache.maven.surefire.shared.utils.io.SelectorUtils;
 
 import static org.apache.maven.plugin.surefire.util.ScannerUtil.convertSlashToSystemFileSeparator;
 
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 dacadc0..559a0f1 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
@@ -75,7 +75,7 @@ import static java.util.Arrays.asList;
 import static java.util.Collections.emptySet;
 import static java.util.Collections.singleton;
 import static java.util.Collections.singletonMap;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
 import static org.apache.maven.artifact.versioning.VersionRange.createFromVersion;
 import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec;
 import static org.fest.assertions.Assertions.assertThat;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java
index 5b15054..4e1ff70 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java
@@ -30,7 +30,7 @@ import java.util.List;
 
 import static java.util.Collections.addAll;
 import static java.util.Collections.singleton;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
 import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath;
 import static org.apache.maven.plugin.surefire.SurefireHelper.reportExecution;
 import static org.fest.assertions.Assertions.assertThat;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
index 616534d..ca42c44 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
@@ -21,7 +21,7 @@ package org.apache.maven.plugin.surefire.booterclient;
 
 import junit.framework.Assert;
 import junit.framework.TestCase;
-import org.apache.commons.io.FileUtils;
+import org.apache.maven.surefire.shared.io.FileUtils;
 import org.apache.maven.surefire.booter.BooterDeserializer;
 import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
 import org.apache.maven.surefire.booter.ClasspathConfiguration;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
index ec844d3..4e9bbc9 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
@@ -20,7 +20,7 @@ package org.apache.maven.plugin.surefire.booterclient;
  */
 
 import junit.framework.TestCase;
-import org.apache.commons.io.FileUtils;
+import org.apache.maven.surefire.shared.io.FileUtils;
 import org.apache.maven.surefire.booter.AbstractPathConfiguration;
 import org.apache.maven.surefire.booter.BooterDeserializer;
 import org.apache.maven.surefire.booter.Classpath;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
index f38f997..72e5372 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
@@ -19,12 +19,12 @@ package org.apache.maven.plugin.surefire.booterclient;
  * under the License.
  */
 
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.SystemUtils;
+import org.apache.maven.surefire.shared.io.FileUtils;
+import org.apache.maven.surefire.shared.lang3.SystemUtils;
 import org.apache.maven.plugin.surefire.JdkAttributes;
 import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger;
-import org.apache.maven.shared.utils.StringUtils;
-import org.apache.maven.shared.utils.cli.Commandline;
+import org.apache.maven.surefire.shared.utils.StringUtils;
+import org.apache.maven.surefire.shared.utils.cli.Commandline;
 import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
 import org.apache.maven.surefire.booter.Classpath;
 import org.apache.maven.surefire.booter.ClasspathConfiguration;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
index a9077fe..492c5c0 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
@@ -43,7 +43,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.nio.file.Files.readAllLines;
 import static java.util.Arrays.asList;
 import static java.util.Collections.singleton;
-import static org.apache.maven.shared.utils.StringUtils.replace;
+import static org.apache.maven.surefire.shared.utils.StringUtils.replace;
 import static org.apache.maven.surefire.booter.Classpath.emptyClasspath;
 import static org.fest.assertions.Assertions.assertThat;
 
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java
index 3cd0fb8..3b35cda 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java
@@ -19,14 +19,14 @@ package org.apache.maven.plugin.surefire.booterclient.lazytestprovider;
  * under the License.
  */
 
-import org.apache.maven.shared.utils.cli.CommandLineException;
+import org.apache.maven.surefire.shared.utils.cli.CommandLineException;
 import org.fest.assertions.Condition;
 import org.junit.Test;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
 import static org.fest.assertions.Assertions.assertThat;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
index 0dfe1b8..abf25ee 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
@@ -33,7 +33,7 @@ import org.apache.maven.plugin.surefire.extensions.SurefireConsoleOutputReporter
 import org.apache.maven.plugin.surefire.extensions.SurefireStatelessReporter;
 import org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter;
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
-import org.apache.maven.shared.utils.logging.MessageUtils;
+import org.apache.maven.surefire.shared.utils.logging.MessageUtils;
 import org.apache.maven.surefire.report.RunStatistics;
 import org.apache.maven.surefire.report.SafeThrowable;
 import org.apache.maven.surefire.report.StackTraceWriter;
@@ -427,4 +427,4 @@ public class DefaultReporterFactoryTest
             return null;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
index 0914051..e6eec81 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
@@ -21,9 +21,9 @@ package org.apache.maven.plugin.surefire.report;
 
 import junit.framework.TestCase;
 import org.apache.maven.plugin.surefire.booterclient.output.DeserializedStacktraceWriter;
-import org.apache.maven.shared.utils.StringUtils;
-import org.apache.maven.shared.utils.xml.Xpp3Dom;
-import org.apache.maven.shared.utils.xml.Xpp3DomBuilder;
+import org.apache.maven.surefire.shared.utils.StringUtils;
+import org.apache.maven.surefire.shared.utils.xml.Xpp3Dom;
+import org.apache.maven.surefire.shared.utils.xml.Xpp3DomBuilder;
 import org.apache.maven.surefire.report.ReportEntry;
 import org.apache.maven.surefire.report.SimpleReportEntry;
 import org.apache.maven.surefire.report.StackTraceWriter;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java
index 7aac381..63e1ac3 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java
@@ -26,7 +26,7 @@ import org.mockito.Mock;
 import org.powermock.core.classloader.annotations.PowerMockIgnore;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+import static org.apache.maven.surefire.shared.utils.logging.MessageUtils.buffer;
 import static org.fest.assertions.Assertions.assertThat;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java
index 1a15fbe..b4ffd1a 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java
@@ -33,7 +33,7 @@ import org.apache.maven.surefire.report.SimpleReportEntry;
 import junit.framework.TestCase;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.commons.io.IOUtils.readLines;
+import static org.apache.maven.surefire.shared.io.IOUtils.readLines;
 import static org.apache.maven.surefire.util.internal.StringUtils.NL;
 import static org.fest.assertions.Assertions.assertThat;
 
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java
index aa10111..a626180 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java
@@ -26,7 +26,7 @@ import org.apache.maven.plugin.surefire.report.ConsoleReporter;
 import org.apache.maven.plugin.surefire.report.FileReporter;
 import org.apache.maven.plugin.surefire.report.TestSetStats;
 import org.apache.maven.plugin.surefire.report.WrappedReportEntry;
-import org.apache.maven.shared.utils.logging.MessageUtils;
+import org.apache.maven.surefire.shared.utils.logging.MessageUtils;
 import org.apache.maven.surefire.report.TestSetReportEntry;
 import org.junit.Test;
 import org.junit.runner.RunWith;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java
index e8922cf..1408583 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java
@@ -29,7 +29,7 @@ import java.util.concurrent.Executors;
 import org.apache.maven.plugin.surefire.report.ConsoleOutputFileReporter;
 
 import junit.framework.TestCase;
-import org.apache.maven.shared.utils.io.FileUtils;
+import org.apache.maven.surefire.shared.utils.io.FileUtils;
 
 import static java.nio.charset.StandardCharsets.US_ASCII;
 import static org.fest.assertions.Assertions.assertThat;
diff --git a/surefire-api/pom.xml b/surefire-api/pom.xml
index 30efd4b..7a91275 100644
--- a/surefire-api/pom.xml
+++ b/surefire-api/pom.xml
@@ -38,12 +38,9 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-shared-utils</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-codec</groupId>
-      <artifactId>commons-codec</artifactId>
+      <groupId>org.apache.maven.surefire</groupId>
+      <artifactId>surefire-shared-utils</artifactId>
+      <version>3.0.0-M4</version>
     </dependency>
     <dependency>
       <groupId>com.google.code.findbugs</groupId>
@@ -90,36 +87,6 @@
           </dependency>
         </dependencies>
       </plugin>
-      <plugin>
-        <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>
-                  <include>commons-codec:commons-codec</include>
-                </includes>
-              </artifactSet>
-              <relocations>
-                <relocation>
-                  <pattern>org.apache.maven.shared.utils</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.api.org.apache.maven.shared.utils</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.commons.codec</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.api.org.apache.commons.codec</shadedPattern>
-                </relocation>
-              </relocations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java b/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
index 6f6b751..c26ca94 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
@@ -22,7 +22,7 @@ package org.apache.maven.surefire;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
-import org.apache.maven.shared.utils.io.SelectorUtils;
+import org.apache.maven.surefire.shared.utils.io.SelectorUtils;
 import org.apache.maven.surefire.util.ScannerFilter;
 
 /**
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkedChannelEncoder.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkedChannelEncoder.java
index f66e137..94f620a 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkedChannelEncoder.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkedChannelEncoder.java
@@ -19,7 +19,7 @@ package org.apache.maven.surefire.booter;
  * under the License.
  */
 
-import org.apache.commons.codec.binary.Base64;
+import org.apache.maven.surefire.shared.codec.binary.Base64;
 import org.apache.maven.plugin.surefire.log.api.ConsoleLoggerUtils;
 import org.apache.maven.surefire.report.ReportEntry;
 import org.apache.maven.surefire.report.RunMode;
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/cli/CommandLineOption.java b/surefire-api/src/main/java/org/apache/maven/surefire/cli/CommandLineOption.java
index 195828a..668df52 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/cli/CommandLineOption.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/cli/CommandLineOption.java
@@ -45,14 +45,4 @@ public enum CommandLineOption
         }
         return options;
     }
-
-    public static List<String> toStrings( Collection<CommandLineOption> options )
-    {
-        List<String> elements = new ArrayList<>( options.size() );
-        for ( CommandLineOption option : options )
-        {
-            elements.add( option.name() );
-        }
-        return elements;
-    }
 }
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/testset/ResolvedTest.java b/surefire-api/src/main/java/org/apache/maven/surefire/testset/ResolvedTest.java
index 56bc279..9b2637b 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/testset/ResolvedTest.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/testset/ResolvedTest.java
@@ -19,18 +19,18 @@ package org.apache.maven.surefire.testset;
  * under the License.
  */
 
-import org.apache.maven.shared.utils.StringUtils;
-import org.apache.maven.shared.utils.io.MatchPatterns;
+import org.apache.maven.surefire.shared.utils.StringUtils;
+import org.apache.maven.surefire.shared.utils.io.MatchPatterns;
 
 import java.util.regex.Pattern;
 
 import static java.io.File.separatorChar;
 import static java.util.regex.Pattern.compile;
-import static org.apache.maven.shared.utils.StringUtils.isBlank;
-import static org.apache.maven.shared.utils.io.MatchPatterns.from;
-import static org.apache.maven.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX;
-import static org.apache.maven.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX;
-import static org.apache.maven.shared.utils.io.SelectorUtils.matchPath;
+import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
+import static org.apache.maven.surefire.shared.utils.io.MatchPatterns.from;
+import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX;
+import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX;
+import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.matchPath;
 
 /**
  * Single pattern test filter resolved from multi pattern filter -Dtest=MyTest#test,AnotherTest#otherTest.
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java b/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
index 266d06a..c7c123a 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
@@ -26,11 +26,11 @@ import java.util.LinkedHashSet;
 import java.util.Set;
 
 import static java.util.Collections.unmodifiableSet;
-import static org.apache.maven.shared.utils.StringUtils.isBlank;
-import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
-import static org.apache.maven.shared.utils.StringUtils.split;
-import static org.apache.maven.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX;
-import static org.apache.maven.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX;
+import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
+import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
+import static org.apache.maven.surefire.shared.utils.StringUtils.split;
+import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX;
+import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX;
 import static java.util.Collections.singleton;
 import static org.apache.maven.surefire.testset.ResolvedTest.Type.CLASS;
 import static org.apache.maven.surefire.testset.ResolvedTest.Type.METHOD;
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
index fdb60f7..12fd968 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
@@ -109,8 +109,8 @@ public class DefaultDirectoryScanner
         String[] tests = EMPTY_STRING_ARRAY;
         if ( basedir.exists() )
         {
-            org.apache.maven.shared.utils.io.DirectoryScanner scanner =
-                new org.apache.maven.shared.utils.io.DirectoryScanner();
+            org.apache.maven.surefire.shared.utils.io.DirectoryScanner scanner =
+                new org.apache.maven.surefire.shared.utils.io.DirectoryScanner();
 
             scanner.setBasedir( basedir );
 
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkedChannelEncoderTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkedChannelEncoderTest.java
index efa89e0..1dcf4d9 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkedChannelEncoderTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkedChannelEncoderTest.java
@@ -36,7 +36,7 @@ import java.util.Map;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.Arrays.copyOfRange;
-import static org.apache.commons.codec.binary.Base64.encodeBase64String;
+import static org.apache.maven.surefire.shared.codec.binary.Base64.encodeBase64String;
 import static org.apache.maven.surefire.booter.ForkedChannelEncoder.encode;
 import static org.apache.maven.surefire.booter.ForkedChannelEncoder.encodeHeader;
 import static org.apache.maven.surefire.booter.ForkedChannelEncoder.encodeMessage;
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java b/surefire-api/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
index 780f2f0..8fd653b 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
@@ -19,7 +19,7 @@ package org.apache.maven.surefire.booter;
  * under the License.
  */
 
-import org.apache.maven.shared.utils.io.FileUtils;
+import org.apache.maven.surefire.shared.utils.io.FileUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
diff --git a/surefire-booter/pom.xml b/surefire-booter/pom.xml
index 63279bd..1fa5045 100644
--- a/surefire-booter/pom.xml
+++ b/surefire-booter/pom.xml
@@ -36,25 +36,6 @@
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-api</artifactId>
       <version>${project.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.maven.shared</groupId>
-          <artifactId>maven-shared-utils</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-shared-utils</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-lang3</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
     </dependency>
     <dependency>
       <groupId>com.google.code.findbugs</groupId>
@@ -62,11 +43,6 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>commons-codec</groupId>
-      <artifactId>commons-codec</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
@@ -133,36 +109,6 @@
           </systemPropertyVariables>
         </configuration>
       </plugin>
-      <plugin>
-        <artifactId>maven-shade-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-            <configuration>
-              <minimizeJar>true</minimizeJar>
-              <artifactSet>
-                <includes>
-                  <include>org.apache.commons:commons-lang3</include>
-                  <include>commons-io:commons-io</include>
-                </includes>
-              </artifactSet>
-              <relocations>
-                <relocation>
-                  <pattern>org.apache.commons.lang3</pattern>
-                  <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.booter.org.apache.commons.io</shadedPattern>
-                </relocation>
-              </relocations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
index 4360b02..d935dd4 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
@@ -37,12 +37,12 @@ import static java.util.concurrent.TimeUnit.DAYS;
 import static java.util.concurrent.TimeUnit.HOURS;
 import static java.util.concurrent.TimeUnit.MINUTES;
 import static java.util.regex.Pattern.compile;
-import static org.apache.commons.io.IOUtils.closeQuietly;
-import static org.apache.commons.lang3.StringUtils.isNotBlank;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_HP_UX;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_UNIX;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
+import static org.apache.maven.surefire.shared.io.IOUtils.closeQuietly;
+import static org.apache.maven.surefire.shared.lang3.StringUtils.isNotBlank;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_HP_UX;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_LINUX;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_UNIX;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
 import static org.apache.maven.surefire.booter.ProcessInfo.unixProcessInfo;
 import static org.apache.maven.surefire.booter.ProcessInfo.windowsProcessInfo;
 import static org.apache.maven.surefire.booter.ProcessInfo.ERR_PROCESS_INFO;
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
index e8223d7..ef76374 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
@@ -36,11 +36,11 @@ import java.util.StringTokenizer;
 import static java.lang.Character.isDigit;
 import static java.lang.Thread.currentThread;
 import static java.util.Objects.requireNonNull;
-import static org.apache.commons.lang3.StringUtils.isNumeric;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_FREE_BSD;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_NET_BSD;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_OPEN_BSD;
+import static org.apache.maven.surefire.shared.lang3.StringUtils.isNumeric;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_FREE_BSD;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_LINUX;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_NET_BSD;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_OPEN_BSD;
 import static org.apache.maven.surefire.util.ReflectionUtils.invokeMethodChain;
 import static org.apache.maven.surefire.util.ReflectionUtils.tryLoadClass;
 
@@ -178,7 +178,7 @@ public final class SystemUtils
     private static BigDecimal getJavaSpecificationVersion()
     {
         StringBuilder fractionalVersion = new StringBuilder( "0" );
-        for ( char c : org.apache.commons.lang3.SystemUtils.JAVA_SPECIFICATION_VERSION.toCharArray() )
+        for ( char c : org.apache.maven.surefire.shared.lang3.SystemUtils.JAVA_SPECIFICATION_VERSION.toCharArray() )
         {
             if ( isDigit( c ) )
             {
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java
index 434ca80..3f6d148 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java
@@ -19,7 +19,7 @@ package org.apache.maven.surefire.booter;
  * under the License.
  */
 
-import org.apache.commons.io.FileUtils;
+import org.apache.maven.surefire.shared.io.FileUtils;
 import org.junit.Test;
 
 import java.io.File;
@@ -211,4 +211,4 @@ public class ForkedBooterTest
                 .contains( "\"main\"" )
                 .contains( "java.lang.Thread.State: RUNNABLE" );
     }
-}
\ No newline at end of file
+}
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
index 424eb5f..e67d0b3 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
@@ -28,8 +28,8 @@ import java.lang.management.ManagementFactory;
 import java.util.regex.Matcher;
 
 import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_UNIX;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_UNIX;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
 import static org.apache.maven.surefire.booter.ProcessInfo.unixProcessInfo;
 import static org.apache.maven.surefire.booter.ProcessInfo.windowsProcessInfo;
 import static org.fest.assertions.Assertions.assertThat;
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
index 34faff0..c504e04 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
@@ -32,12 +32,12 @@ import java.lang.management.ManagementFactory;
 import java.math.BigDecimal;
 
 import static java.io.File.separator;
-import static org.apache.commons.lang3.JavaVersion.JAVA_9;
-import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_FREE_BSD;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_NET_BSD;
-import static org.apache.commons.lang3.SystemUtils.IS_OS_OPEN_BSD;
+import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_9;
+import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_FREE_BSD;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_LINUX;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_NET_BSD;
+import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_OPEN_BSD;
 import static org.fest.assertions.Assertions.assertThat;
 import static org.junit.Assume.assumeTrue;
 import static org.mockito.Matchers.any;
diff --git a/surefire-extensions-api/pom.xml b/surefire-extensions-api/pom.xml
index 785411a..5904157 100644
--- a/surefire-extensions-api/pom.xml
+++ b/surefire-extensions-api/pom.xml
@@ -43,6 +43,11 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>com.google.code.findbugs</groupId>
+            <artifactId>jsr305</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.jacoco</groupId>
             <artifactId>org.jacoco.agent</artifactId>
             <classifier>runtime</classifier>
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineExecutor.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineExecutor.java
new file mode 100644
index 0000000..8641287
--- /dev/null
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineExecutor.java
@@ -0,0 +1,128 @@
+package org.apache.maven.surefire.extensions.util;
+
+/*
+ * 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.surefire.shared.utils.cli.CommandLineException;
+import org.apache.maven.surefire.shared.utils.cli.Commandline;
+
+import java.io.Closeable;
+
+import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
+import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.removeShutdownHook;
+
+/**
+ * Programming model with this class:
+ * <pre> {@code
+ * try ( CommandlineExecutor exec = new CommandlineExecutor( cli, endOfStreamsCountdown );
+ *       CommandlineStreams streams = exec.execute() )
+ * {
+ *     // register exec in the shutdown hook to destroy pending process
+ *
+ *     // register streams in the shutdown hook to close all three streams
+ *
+ *     ReadableByteChannel stdOut = streams.getStdOutChannel();
+ *     ReadableByteChannel stdErr = streams.getStdErrChannel();
+ *     WritableByteChannel stdIn = streams.getStdInChannel();
+ *     // lineConsumerThread = new LineConsumerThread( ..., stdErr, ..., endOfStreamsCountdown );
+ *     // lineConsumerThread.start();
+ *
+ *     // stdIn.write( ... );
+ *
+ *     int exitCode = exec.awaitExit();
+ *     // process exitCode
+ * }
+ * catch ( InterruptedException e )
+ * {
+ *     lineConsumerThread.disable();
+ * }
+ * catch ( CommandLineException e )
+ * {
+ *     // handle the exceptions
+ * }
+ * } </pre>
+ */
+public class CommandlineExecutor implements Closeable
+{
+    private final Commandline cli;
+    private final CountdownCloseable endOfStreamsCountdown;
+    private Process process;
+    private volatile Thread shutdownHook;
+
+    public CommandlineExecutor( Commandline cli, CountdownCloseable endOfStreamsCountdown )
+    {
+        // now the surefire-extension-api is dependent on CLI without casting generic type T to unrelated object
+        // and the user would not use maven-surefire-common nothing but the only surefire-extension-api
+        // because maven-surefire-common is used for MOJO plugin and not the user's extensions. The user does not need
+        // to see all MOJO impl. Only the surefire-api, surefire-logger-api and surefire-extension-api.
+        this.cli = cli;
+        this.endOfStreamsCountdown = endOfStreamsCountdown;
+    }
+
+    public CommandlineStreams execute() throws CommandLineException
+    {
+        process = cli.execute();
+        shutdownHook = new ProcessHook( process );
+        addShutDownHook( shutdownHook );
+        return new CommandlineStreams( process );
+    }
+
+    public int awaitExit() throws InterruptedException
+    {
+        try
+        {
+            return process.waitFor();
+        }
+        finally
+        {
+            endOfStreamsCountdown.awaitClosed();
+        }
+    }
+
+    @Override
+    public void close()
+    {
+        if ( shutdownHook != null )
+        {
+            shutdownHook.run();
+            removeShutdownHook( shutdownHook );
+            shutdownHook = null;
+        }
+    }
+
+    private static class ProcessHook extends Thread
+    {
+        private final Process process;
+
+        private ProcessHook( Process process )
+        {
+            super( "cli-shutdown-hook" );
+            this.process = process;
+            setContextClassLoader( null );
+            setDaemon( true );
+        }
+
+        /** {@inheritDoc} */
+        public void run()
+        {
+            process.destroy();
+        }
+    }
+
+}
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineStreams.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineStreams.java
new file mode 100644
index 0000000..43ec328
--- /dev/null
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineStreams.java
@@ -0,0 +1,82 @@
+package org.apache.maven.surefire.extensions.util;
+
+/*
+ * 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 javax.annotation.Nonnull;
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.channels.Channel;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
+
+import static java.nio.channels.Channels.newChannel;
+import static org.apache.maven.surefire.extensions.util.FlushableWritableByteChannel.newFlushableChannel;
+
+/**
+ *
+ */
+public final class CommandlineStreams implements Closeable
+{
+    private final ReadableByteChannel stdOutChannel;
+    private final ReadableByteChannel stdErrChannel;
+    private final WritableByteChannel stdInChannel;
+    private volatile boolean closed;
+
+    public CommandlineStreams( @Nonnull Process process )
+    {
+        InputStream stdOutStream = process.getInputStream();
+        stdOutChannel = newChannel( stdOutStream );
+        InputStream stdErrStream = process.getErrorStream();
+        stdErrChannel = newChannel( stdErrStream );
+        stdInChannel = newFlushableChannel( process.getOutputStream() );
+    }
+
+    public ReadableByteChannel getStdOutChannel()
+    {
+        return stdOutChannel;
+    }
+
+    public ReadableByteChannel getStdErrChannel()
+    {
+        return stdErrChannel;
+    }
+
+    public WritableByteChannel getStdInChannel()
+    {
+        return stdInChannel;
+    }
+
+    @Override
+    public void close() throws IOException
+    {
+        if ( closed )
+        {
+            return;
+        }
+
+        try ( Channel c1 = stdOutChannel;
+              Channel c2 = stdErrChannel;
+              Channel c3 = stdInChannel )
+        {
+            closed = true;
+        }
+    }
+}
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CountdownCloseable.java
similarity index 50%
copy from maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java
copy to surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CountdownCloseable.java
index 8073907..4fb79fe 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CountdownCloseable.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.surefire.util;
+package org.apache.maven.surefire.extensions.util;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,36 +19,39 @@ package org.apache.maven.plugin.surefire.util;
  * under the License.
  */
 
-import org.apache.commons.lang3.StringUtils;
+import javax.annotation.Nonnegative;
 import javax.annotation.Nonnull;
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.concurrent.CountDownLatch;
 
-final class ScannerUtil
+/**
+ * Decrements {@code countdown} and calls {@code closeable} if reached zero.
+ */
+public final class CountdownCloseable
+    implements Closeable
 {
+    private final Closeable closeable;
+    private final CountDownLatch countdown;
 
-    private ScannerUtil()
-    {
-        throw new IllegalStateException( "not instantiable constructor" );
-    }
-
-    @Deprecated
-    private static final String FS = System.getProperty( "file.separator" );
-
-    @Deprecated
-    private static final boolean IS_NON_UNIX_FS = ( !FS.equals( "/" ) );
-
-    @Nonnull public static String convertJarFileResourceToJavaClassName( @Nonnull String test )
+    public CountdownCloseable( @Nonnull Closeable closeable, @Nonnegative int countdown )
     {
-        return StringUtils.removeEnd( test, ".class" ).replace( "/", "." );
+        this.closeable = closeable;
+        this.countdown = new CountDownLatch( countdown );
     }
 
-    public static boolean isJavaClassFile( String file )
+    @Override
+    public void close() throws IOException
     {
-        return file.endsWith( ".class" );
+        countdown.countDown();
+        /*if ( countdown.getCount() == 0L )
+        {
+            closeable.close();
+        }*/
     }
 
-    @Deprecated
-    @Nonnull public static String convertSlashToSystemFileSeparator( @Nonnull String path )
+    public void awaitClosed() throws InterruptedException
     {
-        return ( IS_NON_UNIX_FS ? path.replace( "/", FS ) : path );
+        countdown.await();
     }
 }
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/FlushableWritableByteChannel.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/FlushableWritableByteChannel.java
new file mode 100644
index 0000000..e4112f2
--- /dev/null
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/FlushableWritableByteChannel.java
@@ -0,0 +1,68 @@
+package org.apache.maven.surefire.extensions.util;
+
+/*
+ * 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 javax.annotation.Nonnull;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.WritableByteChannel;
+
+import static java.nio.channels.Channels.newChannel;
+
+/**
+ *
+ */
+final class FlushableWritableByteChannel implements WritableByteChannel
+{
+    private final OutputStream os;
+    private final WritableByteChannel channel;
+
+    private FlushableWritableByteChannel( @Nonnull OutputStream os )
+    {
+        this.os = os;
+        this.channel = newChannel( os );
+    }
+
+    static synchronized WritableByteChannel newFlushableChannel( OutputStream os )
+    {
+        return new FlushableWritableByteChannel( os );
+    }
+
+    @Override
+    public int write( ByteBuffer src ) throws IOException
+    {
+        int countWrittenBytes = channel.write( src );
+        os.flush();
+        return countWrittenBytes;
+    }
+
+    @Override
+    public boolean isOpen()
+    {
+        return channel.isOpen();
+    }
+
+    @Override
+    public void close() throws IOException
+    {
+        channel.close();
+    }
+}
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/LineConsumerThread.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/LineConsumerThread.java
new file mode 100644
index 0000000..109e541
--- /dev/null
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/LineConsumerThread.java
@@ -0,0 +1,101 @@
+package org.apache.maven.surefire.extensions.util;
+
+/*
+ * 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.surefire.shared.utils.cli.StreamConsumer;
+
+import javax.annotation.Nonnull;
+import java.io.Closeable;
+import java.io.IOException;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.charset.Charset;
+import java.util.Scanner;
+
+/**
+ *
+ */
+public final class LineConsumerThread extends Thread implements Closeable
+{
+    private final Charset encoding;
+    private final ReadableByteChannel channel;
+    private final StreamConsumer consumer;
+    private final CountdownCloseable countdownCloseable;
+    private volatile boolean disabled;
+
+    public LineConsumerThread( @Nonnull String threadName,
+                               @Nonnull ReadableByteChannel channel, @Nonnull StreamConsumer consumer,
+                               @Nonnull CountdownCloseable countdownCloseable )
+    {
+        this( threadName, channel, consumer, countdownCloseable, Charset.defaultCharset() );
+    }
+
+    public LineConsumerThread( @Nonnull String threadName,
+                               @Nonnull ReadableByteChannel channel, @Nonnull StreamConsumer consumer,
+                               @Nonnull CountdownCloseable countdownCloseable, @Nonnull Charset encoding )
+    {
+        setName( threadName );
+        setDaemon( true );
+        this.channel = channel;
+        this.consumer = consumer;
+        this.countdownCloseable = countdownCloseable;
+        this.encoding = encoding;
+    }
+
+    @Override
+    public void run()
+    {
+        try ( Scanner stream = new Scanner( channel, encoding.name() );
+              CountdownCloseable c = countdownCloseable; )
+        {
+            boolean isError = false;
+            while ( stream.hasNextLine() )
+            {
+                try
+                {
+                    String line = stream.nextLine();
+                    isError |= stream.ioException() != null;
+                    if ( !isError && !disabled )
+                    {
+                        consumer.consumeLine( line );
+                    }
+                }
+                catch ( IllegalStateException e )
+                {
+                    isError = true;
+                }
+            }
+        }
+        catch ( IllegalStateException | IOException e )
+        {
+            // not needed
+        }
+    }
+
+    public void disable()
+    {
+        disabled = true;
+    }
+
+    @Override
+    public void close() throws IOException
+    {
+        channel.close();
+    }
+}
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/StreamFeeder.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/StreamFeeder.java
new file mode 100644
index 0000000..80feb00
--- /dev/null
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/StreamFeeder.java
@@ -0,0 +1,89 @@
+package org.apache.maven.surefire.extensions.util;
+
+/*
+ * 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 javax.annotation.Nonnull;
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.ClosedChannelException;
+import java.nio.channels.NonWritableChannelException;
+import java.nio.channels.WritableByteChannel;
+
+/**
+ *
+ */
+public class StreamFeeder extends Thread implements Closeable
+{
+    private final WritableByteChannel channel;
+    private final InputStream is;
+
+    private volatile boolean disabled;
+    private volatile Throwable exception;
+
+    public StreamFeeder( @Nonnull String threadName, @Nonnull WritableByteChannel channel, @Nonnull InputStream is )
+    {
+        setName( threadName );
+        setDaemon( true );
+        this.channel = channel;
+        this.is = is;
+    }
+
+    @Override
+    public void run()
+    {
+        try
+        {
+            for ( int data = is.read(); data != -1; data = is.read()  )
+            {
+                if ( !disabled )
+                {
+                    // todo use CommandReader interface instead of InputStream. Then we would write ByteBuffer.
+                    channel.write( ByteBuffer.wrap( new byte[] {(byte) data} ) );
+                }
+            }
+        }
+        catch ( ClosedChannelException e )
+        {
+            // closed externally
+        }
+        catch ( IOException | NonWritableChannelException e )
+        {
+            exception = e.getCause() == null ? e : e.getCause();
+        }
+    }
+
+    public void disable()
+    {
+        disabled = true;
+    }
+
+    public Throwable getException()
+    {
+        return exception;
+    }
+
+    @Override
+    public void close() throws IOException
+    {
+        channel.close();
+    }
+}
diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml
index a49244f..05e50a2 100644
--- a/surefire-its/pom.xml
+++ b/surefire-its/pom.xml
@@ -167,7 +167,8 @@
                 <artifactId>maven-failsafe-plugin</artifactId>
                 <version>3.0.0-M4</version> <!-- ${shadedVersion}, but resolved due to https://issues.apache.org/jira/browse/MRELEASE-799 -->
                 <configuration>
-                    <skipTests>${skipTests}</skipTests>
+                    <skipITs>false</skipITs>
+                    <skipTests>false</skipTests>
                     <jvm>${jdk.home}/bin/java</jvm>
                     <runOrder>alphabetical</runOrder>
                     <threadCount>1</threadCount>
@@ -175,7 +176,7 @@
                     <forkMode>once</forkMode>
                     <argLine>-server -Xmx64m -XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true -Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
                     <includes>
-                        <include>org/apache/**/*IT*.java</include>
+                        <include>org/apache/**/Surefire735ForkFailWithRedirectConsoleOutputIT.java</include>
                     </includes>
                     <!-- Pass current surefire version to the main suite so that it -->
                     <!-- can forward to all integration test projects. SUREFIRE-513 -->
@@ -192,7 +193,7 @@
                         <!-- see the f/w com.googlecode.junit-toolbox:junit-toolbox -->
                         <maxParallelTestThreads>3</maxParallelTestThreads>
                     </systemPropertyVariables>
-                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+<!--                    <redirectTestOutputToFile>true</redirectTestOutputToFile>-->
                 </configuration>
                 <dependencies>
                     <dependency>
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java
index 34504c1..81d80ea 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java
@@ -38,16 +38,16 @@ public class Surefire735ForkFailWithRedirectConsoleOutputIT
 
     @Test
     public void vmStartFail()
-            throws Exception
     {
+        System.out.println( "verifier.forkMode=" + System.getProperty( "verifier.forkMode" ) );
         OutputValidator outputValidator = unpack().failNever().executeTest();
         assertJvmCrashed( outputValidator );
     }
 
     @Test
     public void vmStartFailShouldFailBuildk()
-            throws Exception
     {
+        System.out.println( "verifier.forkMode=" + System.getProperty( "verifier.forkMode" ) );
         OutputValidator outputValidator = unpack().maven().withFailure().executeTest();
         assertJvmCrashed( outputValidator );
     }
@@ -69,12 +69,13 @@ public class Surefire735ForkFailWithRedirectConsoleOutputIT
                                                  }
                                              }
         );
+
         assertThat( dumpFiles ).isNotEmpty();
+
         for ( String dump : dumpFiles )
         {
             outputValidator.getSurefireReportsFile( dump )
                     .assertContainsText( "Invalid maximum heap size: -Xmxxxx712743m" );
         }
     }
-
 }
diff --git a/surefire-providers/common-java5/pom.xml b/surefire-providers/common-java5/pom.xml
index 8e30ca3..9245b97 100644
--- a/surefire-providers/common-java5/pom.xml
+++ b/surefire-providers/common-java5/pom.xml
@@ -33,8 +33,9 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-shared-utils</artifactId>
+      <groupId>org.apache.maven.surefire</groupId>
+      <artifactId>surefire-shared-utils</artifactId>
+      <version>3.0.0-M4</version>
     </dependency>
   </dependencies>
 
@@ -56,31 +57,6 @@
         </configuration>
       </plugin>
       <plugin>
-        <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.utils</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.java5.org.apache.maven.shared.utils</shadedPattern>
-                </relocation>
-              </relocations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <argLine>${jvm.args.tests} ${jacoco.agent}</argLine>
diff --git a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/SmartStackTraceParser.java b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/SmartStackTraceParser.java
index 134d292..2fd0f83 100644
--- a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/SmartStackTraceParser.java
+++ b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/SmartStackTraceParser.java
@@ -25,8 +25,8 @@ import java.util.List;
 import static java.lang.Math.min;
 import static java.util.Arrays.asList;
 import static java.util.Collections.reverse;
-import static org.apache.maven.shared.utils.StringUtils.chompLast;
-import static org.apache.maven.shared.utils.StringUtils.isNotEmpty;
+import static org.apache.maven.surefire.shared.utils.StringUtils.chompLast;
+import static org.apache.maven.surefire.shared.utils.StringUtils.isNotEmpty;
 
 /**
  * @author Kristian Rosenvold
@@ -171,7 +171,7 @@ public class SmartStackTraceParser
         if ( i >= 0 && msg != null )
         {
             truncatedMessage.append( ' ' )
-                    .append( msg.substring( 0, min( i, msg.length() ) ) );
+                    .append( msg, 0, min( i, msg.length() ) );
 
             if ( i < msg.length() )
             {
diff --git a/surefire-report-parser/pom.xml b/surefire-report-parser/pom.xml
index 5b6e771..b9866c3 100644
--- a/surefire-report-parser/pom.xml
+++ b/surefire-report-parser/pom.xml
@@ -39,8 +39,9 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-shared-utils</artifactId>
+      <groupId>org.apache.maven.surefire</groupId>
+      <artifactId>surefire-shared-utils</artifactId>
+      <version>3.0.0-M4</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
@@ -80,31 +81,6 @@
           </includes>
         </configuration>
       </plugin>
-      <plugin>
-        <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.utils</pattern>
-                  <shadedPattern>org.apache.maven.surefire.shade.report.org.apache.maven.shared.utils</shadedPattern>
-                </relocation>
-              </relocations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java
index bd1429b..cea9247 100644
--- a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java
+++ b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java
@@ -19,7 +19,7 @@ package org.apache.maven.plugins.surefire.report;
  * under the License.
  */
 
-import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
+import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
 
 /**
  *
diff --git a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
index f6e644f..9e0979f 100644
--- a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
+++ b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
@@ -33,10 +33,10 @@ import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
 import org.apache.maven.reporting.MavenReportException;
-import org.apache.maven.shared.utils.io.DirectoryScanner;
+import org.apache.maven.surefire.shared.utils.io.DirectoryScanner;
 import org.xml.sax.SAXException;
 
-import static org.apache.maven.shared.utils.StringUtils.split;
+import static org.apache.maven.surefire.shared.utils.StringUtils.split;
 
 /**
  *
diff --git a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
index 943bcdd..d190298 100644
--- a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
+++ b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
@@ -35,7 +35,7 @@ import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
-import org.apache.maven.shared.utils.StringUtils;
+import org.apache.maven.surefire.shared.utils.StringUtils;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;