maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r1029089 - in /maven/surefire/trunk: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ surefire-booter/src/main/java/org/apache/maven/surefire/booter/
Date Sat, 30 Oct 2010 14:55:50 GMT
Author: bentmann
Date: Sat Oct 30 14:55:50 2010
New Revision: 1029089

URL: http://svn.apache.org/viewvc?rev=1029089&view=rev
Log:
[SUREFIRE-652] Store surefire tmp files under target/ instead of java.io.tmpdir

Modified:
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java?rev=1029089&r1=1029088&r2=1029089&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
Sat Oct 30 14:55:50 2010
@@ -449,6 +449,10 @@ public abstract class AbstractSurefireMo
 
         fork.setForkMode( getForkMode() );
 
+        File tmpDir = new File( getReportsDirectory().getParentFile(), "surefire" );
+        tmpDir.mkdirs();
+        fork.setTempDirectory( tmpDir );
+
         processSystemProperties( !fork.isForking() );
 
         if ( getLog().isDebugEnabled() )

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java?rev=1029089&r1=1029088&r2=1029089&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkConfiguration.java
Sat Oct 30 14:55:50 2010
@@ -64,6 +64,8 @@ public class ForkConfiguration
 
     private File workingDirectory;
 
+    private File tempDirectory;
+
     private boolean debug;
     
     private String debugLine;
@@ -133,6 +135,16 @@ public class ForkConfiguration
         this.workingDirectory = workingDirectory;
     }
 
+    public void setTempDirectory( File tempDirectory )
+    {
+        this.tempDirectory = tempDirectory;
+    }
+
+    public File getTempDirectory()
+    {
+        return tempDirectory;
+    }
+
     public String getForkMode()
     {
         return forkMode;
@@ -225,7 +237,7 @@ public class ForkConfiguration
     private File createJar( List classPath )
         throws IOException
     {
-        File file = File.createTempFile( "surefirebooter", ".jar" );
+        File file = File.createTempFile( "surefirebooter", ".jar", tempDirectory );
         if ( !debug )
         {
             file.deleteOnExit();

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java?rev=1029089&r1=1029088&r2=1029089&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
Sat Oct 30 14:55:50 2010
@@ -526,7 +526,7 @@ public class SurefireBooter
     private File writePropertiesFile( String name, Properties properties )
         throws IOException
     {
-        File file = File.createTempFile( name, "tmp" );
+        File file = File.createTempFile( name, "tmp", forkConfiguration.getTempDirectory()
);
         if ( !forkConfiguration.isDebug() )
         {
             file.deleteOnExit();



Mime
View raw message