From 72b256142268af60c8cef0586605306ed25dfc46 Mon Sep 17 00:00:00 2001 From: "saponenko.denis" Date: Wed, 21 Sep 2016 15:53:33 +0300 Subject: [PATCH 1/2] Tests runed in multiple process use one temporary directory. Each process removed temporary directory after execute. For example configuration https://jenkins.io/blog/2016/06/16/parallel-test-executor-plugin/ Correct implementation version Correct javadoc Merge remote-tracking branch 'upstream/master' --- .../plugin/surefire/AbstractSurefireMojo.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 7e1c2a7716..423d4404c4 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 @@ -329,6 +329,14 @@ public abstract class AbstractSurefireMojo @Parameter( property = "forkMode", defaultValue = "once" ) private String forkMode; + /** + * Directory for temporary test files. Be removed after tests execute. Value is relative path from reportsDirectory parent + * + * @since 2.19 + */ + @Parameter( property = "tempDir", defaultValue = "surefire" ) + private String tempDir; + /** * Option to specify the jvm (or path to the java executable) to use with the forking options. For the default, the * jvm will be a new instance of the same VM as the one used to run Maven. JVM settings are not inherited from @@ -2032,7 +2040,7 @@ private Artifact getSurefireBooterArtifact() */ private File getSurefireTempDir() { - return new File( getProjectBuildDirectory(), "surefire" ); + return new File( getReportsDirectory().getParentFile(), getTempDir() ); } /** @@ -3301,4 +3309,12 @@ protected void logDebugOrCliShowErrors( String s ) { SurefireHelper.logDebugOrCliShowErrors( s, getConsoleLogger(), cli ); } + + public String getTempDir() { + return tempDir; + } + + public void setTempDir(String tempDir) { + this.tempDir = tempDir; + } } From a3d9c48d541be7d68c7b42c14c11a2bf845ee66a Mon Sep 17 00:00:00 2001 From: dsaponenko Date: Sun, 30 Oct 2016 02:40:59 +0300 Subject: [PATCH 2/2] javadocfix --- .../apache/maven/plugin/surefire/AbstractSurefireMojo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 423d4404c4..2c62094d60 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 @@ -330,9 +330,9 @@ public abstract class AbstractSurefireMojo private String forkMode; /** - * Directory for temporary test files. Be removed after tests execute. Value is relative path from reportsDirectory parent + * Relative path to project.build.directory containing internal Surefire temporary files. It is removed after the test set has completed. * - * @since 2.19 + * @since 2.19.2 */ @Parameter( property = "tempDir", defaultValue = "surefire" ) private String tempDir;