Author: olamy Date: Sun Aug 5 13:50:05 2012 New Revision: 1369589 URL: http://svn.apache.org/viewvc?rev=1369589&view=rev Log: do not use interpolated settings when running parallel
Modified: maven/surefire/trunk/surefire-integration-tests/pom.xml maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java Modified: maven/surefire/trunk/surefire-integration-tests/pom.xml URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/pom.xml?rev=1369589&r1=1369588&r2=1369589&view=diff ============================================================================== --- maven/surefire/trunk/surefire-integration-tests/pom.xml (original) +++ maven/surefire/trunk/surefire-integration-tests/pom.xml Sun Aug 5 13:50:05 2012 @@ -76,6 +76,29 @@ </dependencies> <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <version>${shadedVersion}</version> + <configuration> + <!-- Pass current surefire version to the main suite so that it --> + <!-- can forward to all integration test projects. SUREFIRE-513 --> + <systemPropertyVariables> + <surefire.version>${project.version}</surefire.version> + <testng.version>${testng.version}</testng.version> + <maven.home>${mavenHomeUsed}</maven.home> + <maven.settings.file>${project.basedir}/../surefire-setup-integration-tests/target/private/it-settings.xml</maven.settings.file> + <maven.repo.local>${project.basedir}/../surefire-setup-integration-tests/target/it-repo</maven.repo.local> + <maven.test.tmpdir>${project.build.directory}</maven.test.tmpdir> + <user.localRepository>${settings.localRepository}</user.localRepository> + <useInterpolatedSettings>true</useInterpolatedSettings> + <testBuildDirectory>${project.build.testOutputDirectory}</testBuildDirectory> + </systemPropertyVariables> + </configuration> + </plugin> + </plugins> + </pluginManagement> <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> @@ -86,20 +109,6 @@ <plugin> <artifactId>maven-failsafe-plugin</artifactId> <version>${shadedVersion}</version> - <configuration> - <!-- Pass current surefire version to the main suite so that it --> - <!-- can forward to all integration test projects. SUREFIRE-513 --> - <systemPropertyVariables> - <surefire.version>${project.version}</surefire.version> - <testng.version>${testng.version}</testng.version> - <maven.home>${mavenHomeUsed}</maven.home> - <maven.settings.file>${project.basedir}/../surefire-setup-integration-tests/target/private/it-settings.xml</maven.settings.file> - <maven.repo.local>${project.basedir}/../surefire-setup-integration-tests/target/it-repo</maven.repo.local> - <maven.test.tmpdir>${project.build.directory}</maven.test.tmpdir> - <user.localRepository>${settings.localRepository}</user.localRepository> - <testBuildDirectory>${project.build.testOutputDirectory}</testBuildDirectory> - </systemPropertyVariables> - </configuration> <executions> <execution> <goals> @@ -149,6 +158,9 @@ <configuration> <parallel>classes</parallel> <threadCount>${surefire.threadcount}</threadCount> + <systemPropertyVariables combine.self="override"> + <useInterpolatedSettings>false</useInterpolatedSettings> + </systemPropertyVariables> </configuration> </plugin> </plugins> 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=1369589&r1=1369588&r2=1369589&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 Sun Aug 5 13:50:05 2012 @@ -281,34 +281,34 @@ public class SurefireLauncher String userLocalRepo = System.getProperty( "user.localRepository" ); String testBuildDirectory = System.getProperty( "testBuildDirectory" ); - - File interpolatedSettings = null; + boolean useInterpolatedSettings = Boolean.getBoolean( "useInterpolatedSettings" ); try { - - interpolatedSettings = File.createTempFile( "interpolated-settings", "xml" ); - - if ( !interpolatedSettings.exists() ) + if ( useInterpolatedSettings ) { - // hack "a la" invoker plugin to download dependencies from local repo - // and not download from central + File interpolatedSettings = File.createTempFile( "interpolated-settings", "xml" ); - Map<String, String> values = new HashMap<String, String>( 1 ); - values.put( "localRepositoryUrl", toUrl( userLocalRepo ) ); - StrSubstitutor strSubstitutor = new StrSubstitutor( values ); + if ( !interpolatedSettings.exists() ) + { + // hack "a la" invoker plugin to download dependencies from local repo + // and not download from central - String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) ); + Map<String, String> values = new HashMap<String, String>( 1 ); + values.put( "localRepositoryUrl", toUrl( userLocalRepo ) ); + StrSubstitutor strSubstitutor = new StrSubstitutor( values ); - String filtered = strSubstitutor.replace( fileContent ); + String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) ); - FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered ); + String filtered = strSubstitutor.replace( fileContent ); + FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered ); - } - cliOptions.add( "-s " + interpolatedSettings.getAbsolutePath() ); + } + cliOptions.add( "-s " + interpolatedSettings.getAbsolutePath() ); + } verifier.setCliOptions( cliOptions ); verifier.executeGoals( goals, envvars );