Hi Christoph,
For usage with Maven with Forked container you can also use the Maven
plugin to prepare the command for you using the 'prepare-agent' goal
which would set the required vmOption value in a system property
taking care of locating the agent jar from maven repo. Have a look at
[1] and [2] for such usage
1. Use the prepare-agent goal to get a property populated
2. Configure the maven-failsafe-plugin to propagate the property to testcases
3. Read the property and pass it as a vmOption
CoreOptions.vmOption(System.getProperty("coverage.command"))
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.2.201302030002</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<propertyName>coverage.command</propertyName>
...
</configuration>
</execution>
<execution>
<id>report</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
...
</executions>
</plugin>
[1]
https://github.com/apache/felix/blob/trunk/jaas/pom.xml#L309
[2]
https://github.com/apache/felix/blob/trunk/jaas/src/test/java/org/apache/felix/jaas/integration/JaasTestBase.java#L111
Chetan Mehrotra