maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1369218 - /maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
Date Fri, 03 Aug 2012 21:27:57 GMT
Author: olamy
Date: Fri Aug  3 21:27:56 2012
New Revision: 1369218

URL: http://svn.apache.org/viewvc?rev=1369218&view=rev
Log:
no need to interpolate the file on each call

Modified:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java?rev=1369218&r1=1369217&r2=1369218&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
Fri Aug  3 21:27:56 2012
@@ -280,31 +280,37 @@ public class SurefireLauncher
     public OutputValidator executeCurrentGoals()
     {
 
-        // hack "a la" invoker plugin to download dependencies from local repo
-        // and not download from central
-        try
+        String userLocalRepo = System.getProperty( "user.localRepository" );
+        String testBuildDirectory = System.getProperty( "testBuildDirectory" );
+
+        File interpolatedSettings = new File( testBuildDirectory, "interpolated-settings.xml"
);
+        if ( !interpolatedSettings.exists() )
         {
-            String userLocalRepo = System.getProperty( "user.localRepository" );
-            String testBuildDirectory = System.getProperty( "testBuildDirectory" );
+            // hack "a la" invoker plugin to download dependencies from local repo
+            // and not download from central
+            try
+            {
 
-            Map<String, String> values = new HashMap<String, String>( 1 );
-            values.put( "localRepositoryUrl", toUrl( userLocalRepo ) );
-            StrSubstitutor strSubstitutor = new StrSubstitutor( values );
+                Map<String, String> values = new HashMap<String, String>( 1 );
+                values.put( "localRepositoryUrl", toUrl( userLocalRepo ) );
+                StrSubstitutor strSubstitutor = new StrSubstitutor( values );
 
-            String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml"
) );
+                String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml"
) );
 
-            File interpolatedSettings = new File( testBuildDirectory, "interpolated-settings.xml"
);
-            String filtered = strSubstitutor.replace( fileContent );
+                String filtered = strSubstitutor.replace( fileContent );
 
-            FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered );
+                FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered );
 
-            cliOptions.add( "-s " + interpolatedSettings.getAbsolutePath() );
-        }
-        catch ( IOException e )
-        {
-            throw new SurefireVerifierException( e );
+
+            }
+            catch ( IOException e )
+            {
+                throw new SurefireVerifierException( e );
+            }
         }
 
+        cliOptions.add( "-s " + interpolatedSettings.getAbsolutePath() );
+
         verifier.setCliOptions( cliOptions );
         try
         {



Mime
View raw message