Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3
-
None
-
Ubuntu Linux, Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing), maven 2.0.6
Description
I'm unable to disable assertions while running tests with the surefire plugin.
I have product "assert1" with a code with "assert false" (this always throws an AssertionError when assertions are enabled).
I use the code in assert2 in a unit-test and it always throws an assertion error with surefire 2.3.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!-- emi: forcing version to avoid ignoring of -da -->
<!-- <version>2.1.3</version> -->
<configuration>
<forkMode>pertest</forkMode>
<argLine>-da</argLine>
<childDelegation>false</childDelegation>
</configuration>
</plugin>
</plugins>
</build>
I can play with various values for forkMode and childDelegation with no luck.
The only working way is forcing the version to 2.1.33 and with the above settings (pertest forkmode, false childDelegation).
I'm attaching a zip with 2 projects. Trying to run mvn test on assert2 will throw an assertion error except if forcing the surefire version to 2.1.3.