Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.2
-
Fix Version/s: 1.7
-
Component/s: None
-
Labels:None
Description
Some tests can be excluded from surefire execution. Example on commons-email :
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<excludes>
<exclude>org/apache/commons/mail/BaseEmailTestCase.java</exclude>
<exclude>org/apache/commons/mail/mocks/*</exclude>
<exclude>org/apache/commons/mail/settings/*</exclude>
</excludes>
</configuration>
</plugin>
This configuration should be propagated to code coverage plugins (cobertura/clover) :
--> for cobertura (http://mojo.codehaus.org/cobertura-maven-plugin/usage.html#Instrumentation)
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<instrumentation>
<ignores>
<ignore>com.example.boringcode.*</ignore>
</ignores>
<excludes>
<exclude>com/example/dullcode/*/.class</exclude>
<exclude>com/example/**/*Test.class</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin>
--> for clover (http://maven.apache.org/plugins/maven-clover-plugin/usage.html)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clover-plugin</artifactId>
<configuration>
<includes>
<include>*/api//.java</include>
<include>some/path/MyFile.java</include>
[...]
</includes>
<excludes>
<exclude>**/*Test/java</exclude>
[...]
</excludes>
[...]
Also with configuration:
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
all tests in the module should be skipped. It doesn't work in 1.4RC1