Author: pgier
Date: Thu May 13 14:39:11 2010
New Revision: 943900
URL: http://svn.apache.org/viewvc?rev=943900&view=rev
Log:
[SUREFIRE-598] Removing classpath elements should come after the
classes/test-classes config so that they are not re-added to the classpath.
Modified:
maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Modified:
maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=943900&r1=943899&r2=943900&view=diff
==============================================================================
---
maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
(original)
+++
maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Thu May 13 14:39:11 2010
@@ -993,29 +993,6 @@ public class SurefirePlugin
}
}
- //
----------------------------------------------------------------------
- // modify default classpath according to configuration
- if ( ignoreClasspathElements.equals( "all" ) )
- {
- classpathElements.clear();
- }
- else if ( ignoreClasspathElements.equals( "runtime" ) )
- {
- try
- {
- classpathElements.removeAll(
project.getRuntimeClasspathElements() );
- }
- catch ( DependencyResolutionRequiredException e )
- {
- throw new MojoExecutionException ( "Unable to resolve runtime
classpath elements: " + e, e );
- }
- }
- else if ( ! ignoreClasspathElements.equals( "none" ) )
- {
- throw new MojoExecutionException( "Unsupported value for
ignoreClasspathElements parameter: " +
- ignoreClasspathElements );
- }
-
// Check if we need to add configured classes/test classes directories
here.
// If they are configured, we should remove the default to avoid
conflicts.
File projectClassesDirectory = new File(
project.getBuild().getOutputDirectory() );
@@ -1048,6 +1025,29 @@ public class SurefirePlugin
}
}
+ //
----------------------------------------------------------------------
+ // Remove elements from the classpath according to configuration
+ if ( ignoreClasspathElements.equals( "all" ) )
+ {
+ classpathElements.clear();
+ }
+ else if ( ignoreClasspathElements.equals( "runtime" ) )
+ {
+ try
+ {
+ classpathElements.removeAll(
project.getRuntimeClasspathElements() );
+ }
+ catch ( DependencyResolutionRequiredException e )
+ {
+ throw new MojoExecutionException ( "Unable to resolve runtime
classpath elements: " + e, e );
+ }
+ }
+ else if ( ! ignoreClasspathElements.equals( "none" ) )
+ {
+ throw new MojoExecutionException( "Unsupported value for
ignoreClasspathElements parameter: " +
+ ignoreClasspathElements );
+ }
+
getLog().debug( "Test Classpath :" );
for ( Iterator i = classpathElements.iterator(); i.hasNext(); )