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 2016/10/29 21:12:25 UTC

maven-surefire git commit: [SUREFIRE-1296] The project build directory should not be determined as (directory of surefire-reports).getParentFile(). It is a problem if report directory is customized.

Repository: maven-surefire
Updated Branches:
  refs/heads/master b1d11c64b -> 89dc9f97c


[SUREFIRE-1296] The project build directory should not be determined as (directory of surefire-reports).getParentFile(). It is a problem if report directory is customized.


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/89dc9f97
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/89dc9f97
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/89dc9f97

Branch: refs/heads/master
Commit: 89dc9f97c851bed1d8af0ae75143eb692efb75dd
Parents: b1d11c6
Author: Tibor17 <ti...@lycos.com>
Authored: Sat Oct 29 23:06:12 2016 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Sat Oct 29 23:12:07 2016 +0200

----------------------------------------------------------------------
 .../plugin/surefire/AbstractSurefireMojo.java   | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/89dc9f97/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
----------------------------------------------------------------------
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 a3ab13e..7e1c2a7 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
@@ -650,6 +650,13 @@ public abstract class AbstractSurefireMojo
     private Boolean parallelMavenExecution;
 
     /**
+     * Read-only parameter with value of Maven property <i>project.build.directory</i>.
+     * @since 2.19.2
+     */
+    @Parameter( defaultValue = "${project.build.directory}", readonly = true )
+    private File projectBuildDirectory;
+
+    /**
      * List of dependencies to scan for test classes to include in the test run.
      * The child elements of this element must be &lt;dependency&gt; elements, and the
      * contents of each of these elements must be a string which follows the format:
@@ -2025,7 +2032,7 @@ public abstract class AbstractSurefireMojo
      */
     private File getSurefireTempDir()
     {
-        return new File( getReportsDirectory().getParentFile(), "surefire" );
+        return new File( getProjectBuildDirectory(), "surefire" );
     }
 
     /**
@@ -2046,6 +2053,7 @@ public abstract class AbstractSurefireMojo
         checksum.add( getClasspathDependencyScopeExclude() );
         checksum.add( getAdditionalClasspathElements() );
         checksum.add( getReportsDirectory() );
+        checksum.add( getProjectBuildDirectory() );
         checksum.add( getTestSourceDirectory() );
         checksum.add( getTest() );
         checksum.add( getIncludes() );
@@ -3279,6 +3287,16 @@ public abstract class AbstractSurefireMojo
         this.classpathDependencyScopeExclude = classpathDependencyScopeExclude;
     }
 
+    public File getProjectBuildDirectory()
+    {
+        return projectBuildDirectory;
+    }
+
+    public void setProjectBuildDirectory( File projectBuildDirectory )
+    {
+        this.projectBuildDirectory = projectBuildDirectory;
+    }
+
     protected void logDebugOrCliShowErrors( String s )
     {
         SurefireHelper.logDebugOrCliShowErrors( s, getConsoleLogger(), cli );