diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java index 148a689fa8..2df39a478a 100755 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java @@ -80,6 +80,10 @@ private List getInitialGoals() { goals.add("-Dsurefire.version=" + surefireVersion); String jacocoAgent = System.getProperty("jacoco.agent", ""); + // Remove unnecessary backslash escaping for Windows, see https://github.com/jacoco/jacoco/issues/1559 + jacocoAgent = jacocoAgent.replace("\\\\", "\\"); + // Remove quotes which will cause a syntax error raised by cmd.exe because of quote escaping + jacocoAgent = jacocoAgent.replace("\"", ""); goals.add("-Djacoco.agent=" + jacocoAgent); goals.add("-nsu"); diff --git a/surefire-its/src/test/resources/junit47-parallel/pom.xml b/surefire-its/src/test/resources/junit47-parallel/pom.xml index e9d6a6caac..ac04eedd37 100644 --- a/surefire-its/src/test/resources/junit47-parallel/pom.xml +++ b/surefire-its/src/test/resources/junit47-parallel/pom.xml @@ -62,7 +62,7 @@ maven-surefire-plugin - ${argLine} ${jacoco.agent} + ${argLine} "${jacoco.agent}" diff --git a/surefire-its/src/test/resources/testng-740-parallel-without-threadcount/pom.xml b/surefire-its/src/test/resources/testng-740-parallel-without-threadcount/pom.xml index 216efb5a3c..8d4fd22033 100644 --- a/surefire-its/src/test/resources/testng-740-parallel-without-threadcount/pom.xml +++ b/surefire-its/src/test/resources/testng-740-parallel-without-threadcount/pom.xml @@ -43,7 +43,7 @@ maven-surefire-plugin ${surefire.version} - ${argLine} ${jacoco.agent} + ${argLine} "${jacoco.agent}" methods diff --git a/surefire-its/src/test/resources/testng-740-parallel/pom.xml b/surefire-its/src/test/resources/testng-740-parallel/pom.xml index bc39aae81d..867d6adb21 100644 --- a/surefire-its/src/test/resources/testng-740-parallel/pom.xml +++ b/surefire-its/src/test/resources/testng-740-parallel/pom.xml @@ -43,7 +43,7 @@ maven-surefire-plugin ${surefire.version} - ${argLine} ${jacoco.agent} + ${argLine} "${jacoco.agent}" methods 10 diff --git a/surefire-its/src/test/resources/testng-simple/pom.xml b/surefire-its/src/test/resources/testng-simple/pom.xml index 427c713e0e..cace78a2eb 100644 --- a/surefire-its/src/test/resources/testng-simple/pom.xml +++ b/surefire-its/src/test/resources/testng-simple/pom.xml @@ -87,7 +87,7 @@ maven-surefire-plugin ${surefire.version} - ${argLine} ${jacoco.agent} + ${argLine} "${jacoco.agent}" reversealphabetical