Automagic Remote InContainer Codecoverage
Add the following to your pom.xml:
Set the versions to use:
...
<properties>
<version.jacoco>0.7.8</version.jacoco>
<version.arquillian_jacoco>1.0.0.Alpha9</version.arquillian_jacoco>
</properties>
...
Configure the Jacoco Maven plugin and depend on the Arquillian Jacoco Extension:
...
<profile>
<id>jacoco</id>
<dependencies>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core</artifactId>
<version>${version.jacoco}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-jacoco</artifactId>
<version>${version.arquillian_jacoco}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Activate this profile on command line by using the -P flag:
mvn test -Pjacoco