I \'m using maven-sure fire plugin to execute tests and Jacoco plugin to generate the coverage reports. Jacoco does\'t provide coverage reports and instead fails with the d
Quoting http://www.jacoco.org/jacoco/trunk/doc/prepare-agent-mojo.html :
If your project already defines VM arguments for test execution, be sure that they will include property defined by JaCoCo.
One of the ways to do this in case of maven-surefire-plugin - is to use syntax for late property evaluation:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <argLine>@{argLine} -your -extra -arguments</argLine> </configuration> </plugin>
Another way is to define "argLine" as a Maven property rather than as part of the configuration of maven-surefire-plugin:
<properties> <argLine>-your -extra -arguments</argLine> </properties> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <!-- no argLine here --> </configuration> </plugin>
so either define
<argLine>-Xms256m -Xmx512m -XX:MaxPermSize=128m -ea
-Dfile.encoding=UTF-8</argLine>
as property:
<build>
<properties>
<argLine>-Xms256m -Xmx512m -XX:MaxPermSize=128m -ea
-Dfile.encoding=UTF-8</argLine>
</properties>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<!-- no argLine here -->
or add @{argLine}
to it:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<argLine>@{argLine} -Xms256m -Xmx512m -XX:MaxPermSize=128m -ea
-Dfile.encoding=UTF-8</argLine>