You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2021/12/27 17:49:03 UTC
[maven-surefire] branch SUREFIRE-1972 updated (508f73c -> cd3333c)
This is an automated email from the ASF dual-hosted git repository.
sjaranowski pushed a change to branch SUREFIRE-1972
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git.
discard 508f73c [SUREFIRE-1972] Use current version of surefire-shared-utils
new cd3333c [SUREFIRE-1972] Use current version of surefire-shared-utils
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 (508f73c)
\
N -- N -- N refs/heads/SUREFIRE-1972 (cd3333c)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
pom.xml | 3 +++
surefire-booter/pom.xml | 5 +++++
2 files changed, 8 insertions(+)
[maven-surefire] 01/01: [SUREFIRE-1972] Use current version of surefire-shared-utils
Posted by sj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sjaranowski pushed a commit to branch SUREFIRE-1972
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit cd3333c8b45d6af046796347e291f9e7ce6073fe
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Mon Dec 27 18:08:14 2021 +0100
[SUREFIRE-1972] Use current version of surefire-shared-utils
- in tests we can use classes from direct dependency
- in other case delegate classes which will be shaded
---
maven-surefire-common/pom.xml | 6 +-
.../output/ThreadedStreamConsumer.java | 3 +-
.../plugin/surefire/AbstractSurefireMojoTest.java | 6 +-
.../AbstractSurefireMojoToolchainsTest.java | 2 +-
...ooterDeserializerProviderConfigurationTest.java | 2 +-
...BooterDeserializerStartupConfigurationTest.java | 2 +-
.../booterclient/ForkConfigurationTest.java | 2 +-
.../OutputStreamFlushableCommandlineTest.java | 6 +-
.../surefire/report/StatelessXmlReporterTest.java | 6 +-
.../runorder/RunEntryStatisticsMapTest.java | 2 +-
.../report/ConsoleOutputFileReporterTest.java | 2 +-
maven-surefire-report-plugin/pom.xml | 12 ++++
pom.xml | 46 +++++++-----
surefire-api/pom.xml | 1 -
surefire-booter/pom.xml | 5 ++
.../apache/maven/surefire/booter/PpidChecker.java | 16 ++++-
.../maven/surefire/booter/ForkedBooterTest.java | 2 +-
.../surefire/booter/NewClassLoaderRunner.java | 2 +-
.../maven/surefire/booter/SystemUtilsTest.java | 12 ++--
surefire-extensions-api/pom.xml | 1 -
surefire-providers/common-java5/pom.xml | 1 -
surefire-report-parser/pom.xml | 1 -
surefire-shared-utils/pom.xml | 13 ++--
.../shared/compress/archivers/zip/Zip64Mode.java | 41 +++++++++++
.../compress/archivers/zip/ZipArchiveEntry.java | 31 ++++++++
.../archivers/zip/ZipArchiveOutputStream.java | 38 ++++++++++
.../apache/maven/surefire/shared/io/IOUtils.java | 37 ++++++++++
.../surefire/shared/lang3/StringEscapeUtils.java | 39 ++++++++++
.../maven/surefire/shared/lang3/StringUtils.java | 56 +++++++++++++++
.../maven/surefire/shared/lang3/SystemUtils.java | 39 ++++++++++
.../maven/surefire/shared/utils/StringUtils.java | 84 ++++++++++++++++++++++
.../shared/utils/cli/CommandLineException.java | 33 +++++++++
.../shared/utils/cli/CommandLineUtils.java | 33 +++++++++
.../surefire/shared/utils/cli/Commandline.java | 48 +++++++++++++
.../shared/utils/cli/ShutdownHookUtils.java | 36 ++++++++++
.../surefire/shared/utils/io/DirectoryScanner.java | 27 +++++++
.../maven/surefire/shared/utils/io/FileUtils.java | 41 +++++++++++
.../surefire/shared/utils/io/MatchPatterns.java | 44 ++++++++++++
.../surefire/shared/utils/io/SelectorUtils.java | 44 ++++++++++++
.../shared/utils/logging/MessageBuilder.java | 76 ++++++++++++++++++++
.../shared/utils/logging/MessageUtils.java | 39 ++++++++++
.../shared/utils/xml/PrettyPrintXMLWriter.java | 33 +++++++++
.../maven/surefire/shared/utils/xml/XMLWriter.java | 27 +++++++
43 files changed, 946 insertions(+), 51 deletions(-)
diff --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
index 805b247..24e02be 100644
--- a/maven-surefire-common/pom.xml
+++ b/maven-surefire-common/pom.xml
@@ -74,7 +74,11 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-shared-utils</artifactId>
- <version>3.0.0-M4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
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 10920c5..1664ee5 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
@@ -21,7 +21,6 @@ package org.apache.maven.plugin.surefire.booterclient.output;
import org.apache.maven.surefire.api.event.Event;
import org.apache.maven.surefire.extensions.EventHandler;
-import org.apache.maven.surefire.shared.utils.cli.StreamConsumer;
import javax.annotation.Nonnull;
import java.io.Closeable;
@@ -69,7 +68,7 @@ public final class ThreadedStreamConsumer
/**
* Calls {@link ForkClient#handleEvent(Event)} which may throw any {@link RuntimeException}.<br>
* Even if {@link ForkClient} is not fault-tolerant, this method MUST be fault-tolerant and thus the
- * try-catch block must be inside of the loop which prevents from loosing events from {@link StreamConsumer}.
+ * try-catch block must be inside of the loop which prevents from loosing events from StreamConsumer.
* <br>
* If {@link org.apache.maven.plugin.surefire.report.ConsoleOutputFileReporter#writeTestOutput} throws
* {@link java.io.IOException} and then {@code target.consumeLine()} throws any RuntimeException, this method
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 007d24d..04391bd 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
@@ -90,11 +90,11 @@ import static java.util.Collections.emptyList;
import static java.util.Collections.emptyMap;
import static java.util.Collections.singleton;
import static java.util.Collections.singletonList;
+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_WINDOWS;
import static org.apache.maven.artifact.versioning.VersionRange.createFromVersion;
import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec;
-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_WINDOWS;
import static org.codehaus.plexus.languages.java.jpms.ModuleNameSource.MODULEDESCRIPTOR;
import static org.fest.assertions.Assertions.assertThat;
import static org.fest.assertions.MapAssert.entry;
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoToolchainsTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoToolchainsTest.java
index 8468df5..a041a2b 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoToolchainsTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoToolchainsTest.java
@@ -19,9 +19,9 @@ package org.apache.maven.plugin.surefire;
* under the License.
*/
+import org.apache.commons.io.FilenameUtils;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.surefire.shared.io.FilenameUtils;
import org.apache.maven.toolchain.Toolchain;
import org.apache.maven.toolchain.ToolchainManager;
import org.apache.maven.toolchain.java.DefaultJavaToolChain;
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 55f63f3..34c0212 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.maven.surefire.shared.io.FileUtils;
+import org.apache.commons.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 9baf914..41b030d 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,6 +20,7 @@ package org.apache.maven.plugin.surefire.booterclient;
*/
import junit.framework.TestCase;
+import org.apache.commons.io.FileUtils;
import org.apache.maven.surefire.booter.AbstractPathConfiguration;
import org.apache.maven.surefire.booter.BooterDeserializer;
import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
@@ -31,7 +32,6 @@ import org.apache.maven.surefire.api.booter.Shutdown;
import org.apache.maven.surefire.booter.StartupConfiguration;
import org.apache.maven.surefire.api.cli.CommandLineOption;
import org.apache.maven.surefire.api.report.ReporterConfiguration;
-import org.apache.maven.surefire.shared.io.FileUtils;
import org.apache.maven.surefire.api.testset.DirectoryScannerParameters;
import org.apache.maven.surefire.api.testset.RunOrderParameters;
import org.apache.maven.surefire.api.testset.TestArtifactInfo;
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 b1db277..23dd125 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,6 +19,7 @@ package org.apache.maven.plugin.surefire.booterclient;
* under the License.
*/
+import org.apache.commons.io.FileUtils;
import org.apache.maven.plugin.surefire.JdkAttributes;
import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline;
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
@@ -31,7 +32,6 @@ import org.apache.maven.surefire.booter.ModularClasspathConfiguration;
import org.apache.maven.surefire.booter.StartupConfiguration;
import org.apache.maven.surefire.booter.SurefireBooterForkException;
import org.apache.maven.surefire.extensions.ForkNodeFactory;
-import org.apache.maven.surefire.shared.io.FileUtils;
import org.apache.maven.surefire.shared.lang3.SystemUtils;
import org.apache.maven.surefire.shared.utils.StringUtils;
import org.apache.maven.surefire.shared.utils.cli.Commandline;
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 3b35cda..3f32dbd 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
@@ -59,13 +59,15 @@ public class OutputStreamFlushableCommandlineTest
}
@Test
- public void shouldExecute() throws CommandLineException
+ public void shouldExecute() throws CommandLineException, InterruptedException
{
OutputStreamFlushableCommandline cli = new OutputStreamFlushableCommandline();
cli.getShell().setWorkingDirectory( System.getProperty( "user.dir" ) );
cli.getShell().setExecutable( IS_OS_WINDOWS ? "dir" : "ls" );
assertThat( cli.getFlushReceiver() ).isNull();
- cli.execute();
+ Process process = cli.execute();
+ int exitCode = process.waitFor();
+ assertThat( exitCode ).isEqualTo( 0 );
assertThat( cli.getFlushReceiver() ).isNotNull();
}
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 35fad19..c5dec48 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,12 +21,12 @@ 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.api.report.ReportEntry;
import org.apache.maven.surefire.api.report.SimpleReportEntry;
import org.apache.maven.surefire.api.report.StackTraceWriter;
-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 java.io.ByteArrayOutputStream;
import java.io.File;
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 5f6840a..8cde9c8 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
@@ -38,7 +38,7 @@ import junit.framework.TestCase;
import org.apache.maven.surefire.api.util.internal.ClassMethod;
import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.maven.surefire.shared.io.IOUtils.readLines;
+import static org.apache.commons.io.IOUtils.readLines;
import static org.apache.maven.surefire.api.util.internal.StringUtils.NL;
import static org.fest.assertions.Assertions.assertThat;
import static org.powermock.reflect.Whitebox.getInternalState;
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 0846af3..d70dca7 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,9 +29,9 @@ 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.api.report.SimpleReportEntry;
import org.apache.maven.surefire.api.report.TestSetReportEntry;
-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/maven-surefire-report-plugin/pom.xml b/maven-surefire-report-plugin/pom.xml
index 4b02e8e..93e6977 100644
--- a/maven-surefire-report-plugin/pom.xml
+++ b/maven-surefire-report-plugin/pom.xml
@@ -106,6 +106,18 @@
<artifactId>doxia-site-renderer</artifactId>
</dependency>
<dependency>
+ <!-- needed by maven-reporting-impl -->
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <!-- needed by doxia -->
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
diff --git a/pom.xml b/pom.xml
index 4692e25..2522957 100644
--- a/pom.xml
+++ b/pom.xml
@@ -111,22 +111,42 @@
<dependencyManagement>
<dependencies>
+ <!-- project artifacts -->
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
- <version>${commonsCompress}</version>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-shared-utils</artifactId>
+ <version>${project.version}</version>
</dependency>
+ <!-- /project artifacts -->
+
+ <!-- surefire-shared-utils artifacts in provided scope - will be shaded -->
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${commonsLang3Version}</version>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ <version>${mavenSharedUtilsVersion}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commonsIoVersion}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>${commonsLang3Version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <version>${commonsCompress}</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- /surefire-shared-utils artifacts -->
+
+ <dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>3.0</version>
@@ -165,17 +185,6 @@
<version>${mavenVersion}</version>
</dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-shared-utils</artifactId>
- <version>${mavenSharedUtilsVersion}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>3.0.0</version>
@@ -715,6 +724,9 @@
<artifactId>java17</artifactId>
<version>1.0</version>
</signature>
+ <ignores>
+ <ignore>shade.*</ignore>
+ </ignores>
</configuration>
</execution>
</executions>
diff --git a/surefire-api/pom.xml b/surefire-api/pom.xml
index 158c88a..823c93c 100644
--- a/surefire-api/pom.xml
+++ b/surefire-api/pom.xml
@@ -40,7 +40,6 @@
<dependency>
<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>
diff --git a/surefire-booter/pom.xml b/surefire-booter/pom.xml
index db7e3d0..ac54375 100644
--- a/surefire-booter/pom.xml
+++ b/surefire-booter/pom.xml
@@ -48,6 +48,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
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 f2567a9..1d8faf8 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
@@ -22,6 +22,8 @@ package org.apache.maven.surefire.booter;
import org.apache.maven.surefire.api.booter.DumpErrorSingleton;
import javax.annotation.Nonnull;
+
+import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
@@ -39,7 +41,6 @@ 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.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;
@@ -441,6 +442,7 @@ final class PpidChecker
{
destroyableCommands.remove( process );
process.destroy();
+ // process.destroy() - probably close those streams
closeQuietly( process.getInputStream() );
closeQuietly( process.getErrorStream() );
closeQuietly( process.getOutputStream() );
@@ -449,6 +451,18 @@ final class PpidChecker
}
}
+ private void closeQuietly( Closeable closeable )
+ {
+ try
+ {
+ closeable.close();
+ }
+ catch ( IOException e )
+ {
+ // ignore
+ }
+ }
+
@Override
public String toString()
{
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 ef2ba61..1474ed9 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.maven.surefire.shared.io.FileUtils;
+import org.apache.commons.io.FileUtils;
import org.junit.Test;
import java.io.File;
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
index 8fd653b..780f2f0 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
+++ b/surefire-booter/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.surefire.shared.utils.io.FileUtils;
+import org.apache.maven.shared.utils.io.FileUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
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 c504e04..34faff0 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.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.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.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 ee08611..7bc0702 100644
--- a/surefire-extensions-api/pom.xml
+++ b/surefire-extensions-api/pom.xml
@@ -45,7 +45,6 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-shared-utils</artifactId>
- <version>3.0.0-M4</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
diff --git a/surefire-providers/common-java5/pom.xml b/surefire-providers/common-java5/pom.xml
index f76659e..b108ac9 100644
--- a/surefire-providers/common-java5/pom.xml
+++ b/surefire-providers/common-java5/pom.xml
@@ -35,7 +35,6 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-shared-utils</artifactId>
- <version>3.0.0-M4</version>
</dependency>
</dependencies>
diff --git a/surefire-report-parser/pom.xml b/surefire-report-parser/pom.xml
index b452bd7..1461fc5 100644
--- a/surefire-report-parser/pom.xml
+++ b/surefire-report-parser/pom.xml
@@ -41,7 +41,6 @@
<dependency>
<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>
diff --git a/surefire-shared-utils/pom.xml b/surefire-shared-utils/pom.xml
index c845f5c..0dd9fd5 100644
--- a/surefire-shared-utils/pom.xml
+++ b/surefire-shared-utils/pom.xml
@@ -43,18 +43,22 @@
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
+ <scope>compile</scope>
</dependency>
</dependencies>
@@ -68,6 +72,7 @@
<goal>shade</goal>
</goals>
<configuration>
+ <minimizeJar>true</minimizeJar>
<artifactSet>
<includes>
<include>org.apache.maven.shared:maven-shared-utils</include>
@@ -79,19 +84,19 @@
<relocations>
<relocation>
<pattern>org.apache.maven.shared.utils</pattern>
- <shadedPattern>org.apache.maven.surefire.shared.utils</shadedPattern>
+ <shadedPattern>shade.org.apache.maven.shared.utils</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons.io</pattern>
- <shadedPattern>org.apache.maven.surefire.shared.io</shadedPattern>
+ <shadedPattern>shade.org.apache.commons.io</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons.lang3</pattern>
- <shadedPattern>org.apache.maven.surefire.shared.lang3</shadedPattern>
+ <shadedPattern>shade.org.apache.commons.lang3</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons.compress</pattern>
- <shadedPattern>org.apache.maven.surefire.shared.compress</shadedPattern>
+ <shadedPattern>shade.org.apache.commons.compress</shadedPattern>
</relocation>
</relocations>
</configuration>
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/compress/archivers/zip/Zip64Mode.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/compress/archivers/zip/Zip64Mode.java
new file mode 100644
index 0000000..34a9e08
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/compress/archivers/zip/Zip64Mode.java
@@ -0,0 +1,41 @@
+package org.apache.maven.surefire.shared.compress.archivers.zip;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.commons.compress.archivers.zip.Zip64Mode}
+ */
+public enum Zip64Mode
+{
+
+ Never( org.apache.commons.compress.archivers.zip.Zip64Mode.Never );
+
+ private final org.apache.commons.compress.archivers.zip.Zip64Mode mode;
+
+ Zip64Mode( org.apache.commons.compress.archivers.zip.Zip64Mode mode )
+ {
+ this.mode = mode;
+ }
+
+ org.apache.commons.compress.archivers.zip.Zip64Mode getMode()
+ {
+ return mode;
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/compress/archivers/zip/ZipArchiveEntry.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/compress/archivers/zip/ZipArchiveEntry.java
new file mode 100644
index 0000000..3eb0d37
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/compress/archivers/zip/ZipArchiveEntry.java
@@ -0,0 +1,31 @@
+package org.apache.maven.surefire.shared.compress.archivers.zip;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.commons.compress.archivers.zip.ZipArchiveEntry}
+ */
+public class ZipArchiveEntry extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry
+{
+ public ZipArchiveEntry( String name )
+ {
+ super( name );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/compress/archivers/zip/ZipArchiveOutputStream.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/compress/archivers/zip/ZipArchiveOutputStream.java
new file mode 100644
index 0000000..9e11cfa
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/compress/archivers/zip/ZipArchiveOutputStream.java
@@ -0,0 +1,38 @@
+package org.apache.maven.surefire.shared.compress.archivers.zip;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.OutputStream;
+
+/**
+ * Delegate for {@link org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream}
+ */
+public class ZipArchiveOutputStream extends org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
+{
+ public ZipArchiveOutputStream( OutputStream out )
+ {
+ super( out );
+ }
+
+ public void setUseZip64( Zip64Mode mode )
+ {
+ super.setUseZip64( mode.getMode() );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/io/IOUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/io/IOUtils.java
new file mode 100644
index 0000000..5435fe5
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/io/IOUtils.java
@@ -0,0 +1,37 @@
+package org.apache.maven.surefire.shared.io;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.charset.Charset;
+
+/**
+ * Delegate for {@link org.apache.commons.io.IOUtils}
+ */
+public class IOUtils
+{
+
+ public static void write( final CharSequence data, final OutputStream output, final Charset encoding )
+ throws IOException
+ {
+ org.apache.commons.io.IOUtils.write( data, output, encoding );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/lang3/StringEscapeUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/lang3/StringEscapeUtils.java
new file mode 100644
index 0000000..bbb9e94
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/lang3/StringEscapeUtils.java
@@ -0,0 +1,39 @@
+package org.apache.maven.surefire.shared.lang3;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.commons.lang3.StringEscapeUtils }
+ *
+ * @deprecated as of 3.6, use commons-text
+ */
+@Deprecated
+public class StringEscapeUtils
+{
+ public static String escapeXml10( final String input )
+ {
+ return org.apache.commons.lang3.StringEscapeUtils.escapeXml10( input );
+ }
+
+ public static String unescapeXml( final String input )
+ {
+ return org.apache.commons.lang3.StringEscapeUtils.unescapeXml( input );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/lang3/StringUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/lang3/StringUtils.java
new file mode 100644
index 0000000..7f47df2
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/lang3/StringUtils.java
@@ -0,0 +1,56 @@
+package org.apache.maven.surefire.shared.lang3;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.commons.lang3.StringUtils}
+ */
+public class StringUtils
+{
+ public static boolean isBlank( CharSequence cs )
+ {
+ return org.apache.commons.lang3.StringUtils.isBlank( cs );
+ }
+
+ public static boolean isNotBlank( final CharSequence cs )
+ {
+ return org.apache.commons.lang3.StringUtils.isNotBlank( cs );
+ }
+
+ public static boolean isNumeric( final CharSequence cs )
+ {
+ return org.apache.commons.lang3.StringUtils.isNumeric( cs );
+ }
+
+ public static String substringBeforeLast( final String str, final String separator )
+ {
+ return org.apache.commons.lang3.StringUtils.substringBeforeLast( str, separator );
+ }
+
+ public static String trimToNull( final String str )
+ {
+ return org.apache.commons.lang3.StringUtils.trimToNull( str );
+ }
+
+ public static String removeEnd( final String str, final String remove )
+ {
+ return org.apache.commons.lang3.StringUtils.removeEnd( str, remove );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/lang3/SystemUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/lang3/SystemUtils.java
new file mode 100644
index 0000000..29566af
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/lang3/SystemUtils.java
@@ -0,0 +1,39 @@
+package org.apache.maven.surefire.shared.lang3;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.commons.lang3.SystemUtils}
+ */
+public class SystemUtils
+{
+ public static final boolean IS_OS_WINDOWS = org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
+ public static final boolean IS_OS_HP_UX = org.apache.commons.lang3.SystemUtils.IS_OS_HP_UX;
+ public static final boolean IS_OS_LINUX = org.apache.commons.lang3.SystemUtils.IS_OS_LINUX;
+ public static final boolean IS_OS_UNIX = org.apache.commons.lang3.SystemUtils.IS_OS_UNIX;
+ public static final boolean IS_OS_FREE_BSD = org.apache.commons.lang3.SystemUtils.IS_OS_FREE_BSD;
+ public static final boolean IS_OS_NET_BSD = org.apache.commons.lang3.SystemUtils.IS_OS_NET_BSD;
+ public static final boolean IS_OS_OPEN_BSD = org.apache.commons.lang3.SystemUtils.IS_OS_OPEN_BSD;
+
+ public static final String JAVA_SPECIFICATION_VERSION =
+ org.apache.commons.lang3.SystemUtils.JAVA_SPECIFICATION_VERSION;
+
+
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/StringUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/StringUtils.java
new file mode 100644
index 0000000..2e6c2fc
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/StringUtils.java
@@ -0,0 +1,84 @@
+package org.apache.maven.surefire.shared.utils;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Iterator;
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.StringUtils}
+ */
+public class StringUtils
+{
+
+ public static boolean isBlank( String str )
+ {
+ return org.apache.maven.shared.utils.StringUtils.isBlank( str );
+ }
+
+ public static boolean isNotBlank( String str )
+ {
+ return org.apache.maven.shared.utils.StringUtils.isNotBlank( str );
+ }
+
+ public static boolean isEmpty( String str )
+ {
+ return org.apache.maven.shared.utils.StringUtils.isEmpty( str );
+ }
+
+ public static boolean isNotEmpty( String str )
+ {
+ return org.apache.maven.shared.utils.StringUtils.isNotEmpty( str );
+ }
+
+ public static String capitalizeFirstLetter( String data )
+ {
+ return org.apache.maven.shared.utils.StringUtils.capitalizeFirstLetter( data );
+ }
+
+ public static String join( Object[] array, String separator )
+ {
+ return org.apache.maven.shared.utils.StringUtils.join( array, separator );
+ }
+
+ public static String join( Iterator<?> iterator, String separator )
+ {
+ return org.apache.maven.shared.utils.StringUtils.join( iterator, separator );
+ }
+
+ public static String chompLast( String str, String sep )
+ {
+ return org.apache.maven.shared.utils.StringUtils.chompLast( str, sep );
+ }
+
+ public static String replace( String text, String repl, String with )
+ {
+ return org.apache.maven.shared.utils.StringUtils.replace( text, repl, with );
+ }
+
+ public static String[] split( String text )
+ {
+ return org.apache.maven.shared.utils.StringUtils.split( text );
+ }
+
+ public static String[] split( String text, String separator )
+ {
+ return org.apache.maven.shared.utils.StringUtils.split( text, separator );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/CommandLineException.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/CommandLineException.java
new file mode 100644
index 0000000..141484a
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/CommandLineException.java
@@ -0,0 +1,33 @@
+package org.apache.maven.surefire.shared.utils.cli;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.cli.CommandLineException}
+ */
+public class CommandLineException extends org.apache.maven.shared.utils.cli.CommandLineException
+{
+ private static final long serialVersionUID = -5958177641237349931L;
+
+ public CommandLineException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/CommandLineUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/CommandLineUtils.java
new file mode 100644
index 0000000..e8bcbda
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/CommandLineUtils.java
@@ -0,0 +1,33 @@
+package org.apache.maven.surefire.shared.utils.cli;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Properties;
+
+/**
+ * * Delegate for {@link org.apache.maven.shared.utils.cli.CommandLineUtils}
+ */
+public class CommandLineUtils
+{
+ public static Properties getSystemEnvVars()
+ {
+ return org.apache.maven.shared.utils.cli.CommandLineUtils.getSystemEnvVars();
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/Commandline.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/Commandline.java
new file mode 100644
index 0000000..6920297
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/Commandline.java
@@ -0,0 +1,48 @@
+package org.apache.maven.surefire.shared.utils.cli;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.cli.Commandline}
+ */
+public class Commandline extends org.apache.maven.shared.utils.cli.Commandline
+{
+ public Commandline()
+ {
+ super();
+ }
+
+ public Commandline( String toProcess )
+ {
+ super( toProcess );
+ }
+
+ public Process execute() throws CommandLineException
+ {
+ try
+ {
+ return super.execute();
+ }
+ catch ( org.apache.maven.shared.utils.cli.CommandLineException e )
+ {
+ throw new CommandLineException( e.getMessage(), e.getCause() );
+ }
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/ShutdownHookUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/ShutdownHookUtils.java
new file mode 100644
index 0000000..c3227e6
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/cli/ShutdownHookUtils.java
@@ -0,0 +1,36 @@
+package org.apache.maven.surefire.shared.utils.cli;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.cli.ShutdownHookUtils}
+ */
+public class ShutdownHookUtils
+{
+ public static void addShutDownHook( Thread hook )
+ {
+ org.apache.maven.shared.utils.cli.ShutdownHookUtils.addShutDownHook( hook );
+ }
+
+ public static void removeShutdownHook( Thread hook )
+ {
+ org.apache.maven.shared.utils.cli.ShutdownHookUtils.removeShutdownHook( hook );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/DirectoryScanner.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/DirectoryScanner.java
new file mode 100644
index 0000000..82bef9e
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/DirectoryScanner.java
@@ -0,0 +1,27 @@
+package org.apache.maven.surefire.shared.utils.io;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.io.DirectoryScanner}
+ */
+public class DirectoryScanner extends org.apache.maven.shared.utils.io.DirectoryScanner
+{
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/FileUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/FileUtils.java
new file mode 100644
index 0000000..813b5e7
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/FileUtils.java
@@ -0,0 +1,41 @@
+package org.apache.maven.surefire.shared.utils.io;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.io.FileUtils}
+ */
+public class FileUtils
+{
+
+ public static void deleteDirectory( final File directory ) throws IOException
+ {
+ org.apache.maven.shared.utils.io.FileUtils.deleteDirectory( directory );
+ }
+
+ public static List<String> loadFile( File file ) throws IOException
+ {
+ return org.apache.maven.shared.utils.io.FileUtils.loadFile( file );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/MatchPatterns.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/MatchPatterns.java
new file mode 100644
index 0000000..b5b293e
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/MatchPatterns.java
@@ -0,0 +1,44 @@
+package org.apache.maven.surefire.shared.utils.io;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.io.MatchPatterns}
+ */
+public class MatchPatterns
+{
+
+ private final org.apache.maven.shared.utils.io.MatchPatterns matchPatterns;
+
+ public MatchPatterns( org.apache.maven.shared.utils.io.MatchPatterns matchPatterns )
+ {
+ this.matchPatterns = matchPatterns;
+ }
+
+ public static MatchPatterns from( String... sources )
+ {
+ return new MatchPatterns( org.apache.maven.shared.utils.io.MatchPatterns.from( sources ) );
+ }
+
+ public boolean matches( String name, boolean isCaseSensitive )
+ {
+ return matchPatterns.matches( name, isCaseSensitive );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/SelectorUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/SelectorUtils.java
new file mode 100644
index 0000000..0d3ca3a
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/io/SelectorUtils.java
@@ -0,0 +1,44 @@
+package org.apache.maven.surefire.shared.utils.io;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.io.SelectorUtils}
+ */
+public class SelectorUtils
+{
+ public static final String PATTERN_HANDLER_SUFFIX =
+ org.apache.maven.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX;
+
+ public static final String REGEX_HANDLER_PREFIX =
+ org.apache.maven.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX;
+
+
+ public static boolean matchPath( String pattern, String str )
+ {
+ return org.apache.maven.shared.utils.io.SelectorUtils.matchPath( pattern, str );
+ }
+
+ public static boolean matchPath( String pattern, String str, boolean isCaseSensitive )
+ {
+ return org.apache.maven.shared.utils.io.SelectorUtils.matchPath( pattern, str, isCaseSensitive );
+ }
+
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/logging/MessageBuilder.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/logging/MessageBuilder.java
new file mode 100644
index 0000000..1e410cc
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/logging/MessageBuilder.java
@@ -0,0 +1,76 @@
+package org.apache.maven.surefire.shared.utils.logging;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.logging.MessageBuilder}
+ */
+public class MessageBuilder
+{
+
+ private final org.apache.maven.shared.utils.logging.MessageBuilder buffer;
+
+ public MessageBuilder( org.apache.maven.shared.utils.logging.MessageBuilder buffer )
+ {
+
+ this.buffer = buffer;
+ }
+
+ public MessageBuilder a( CharSequence value )
+ {
+ buffer.a( value );
+ return this;
+ }
+
+ public MessageBuilder a( Object value )
+ {
+ buffer.a( value );
+ return this;
+ }
+
+ public MessageBuilder strong( Object message )
+ {
+ buffer.strong( message );
+ return this;
+ }
+
+ public MessageBuilder success( Object message )
+ {
+ buffer.success( message );
+ return this;
+ }
+
+ public MessageBuilder failure( Object message )
+ {
+ buffer.failure( message );
+ return this;
+ }
+
+ public MessageBuilder warning( Object message )
+ {
+ buffer.warning( message );
+ return this;
+ }
+
+ public String toString()
+ {
+ return buffer.toString();
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/logging/MessageUtils.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/logging/MessageUtils.java
new file mode 100644
index 0000000..453e188
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/logging/MessageUtils.java
@@ -0,0 +1,39 @@
+package org.apache.maven.surefire.shared.utils.logging;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegated for {@link org.apache.maven.shared.utils.logging.MessageUtils}
+ */
+public class MessageUtils
+{
+
+ public static MessageBuilder buffer()
+ {
+ return new MessageBuilder( org.apache.maven.shared.utils.logging.MessageUtils.buffer() );
+ }
+
+ public static void setColorEnabled( boolean flag )
+ {
+ org.apache.maven.shared.utils.logging.MessageUtils.setColorEnabled( flag );
+ }
+
+
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/xml/PrettyPrintXMLWriter.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/xml/PrettyPrintXMLWriter.java
new file mode 100644
index 0000000..965dd8c
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/xml/PrettyPrintXMLWriter.java
@@ -0,0 +1,33 @@
+package org.apache.maven.surefire.shared.utils.xml;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.Writer;
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter}
+ */
+public class PrettyPrintXMLWriter extends org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter implements XMLWriter
+{
+ public PrettyPrintXMLWriter( Writer writer )
+ {
+ super( writer );
+ }
+}
diff --git a/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/xml/XMLWriter.java b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/xml/XMLWriter.java
new file mode 100644
index 0000000..9e711ca
--- /dev/null
+++ b/surefire-shared-utils/src/main/java/org/apache/maven/surefire/shared/utils/xml/XMLWriter.java
@@ -0,0 +1,27 @@
+package org.apache.maven.surefire.shared.utils.xml;
+
+/*
+ * 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.
+ */
+
+/**
+ * Delegate for {@link org.apache.maven.shared.utils.xml.XMLWriter}
+ */
+public interface XMLWriter extends org.apache.maven.shared.utils.xml.XMLWriter
+{
+}