I’m trying to get coverage of JBoss AS 7. Here’s my branch:
https://github.com/OndraZizka/jboss-as/tree/TS-jacoco
When I run mvn clean install -rf testsuite -DallTests -Dcoverage -fae I get (almost) empty jacoco.exec files – just some metadata (size is few bytes).
The JVM arg line used is:
-javaagent:${jbossas.ts.dir}/target/jacoco-jars/agent/jacocoagent.jar=destfile=${basedir}/target/jacoco.exec,includes=${jboss.home}/modules/**/*,excludes=${basedir}/target/classes/**/*,append=true,output=file
This line is passed to Arquillian to use to start JBoss AS 7.
The testsuite runs, the argument is passed (it appears in AS7’s boot.log), but the resulting jacoco.exec file is only few bytes in size. The report of course shows no coverage.
What am I doing wrong?
Resolved – the “includes” and “excludes” parameters of the agent refer to class names, not files.
Correct JVM agent argument for my case is:
My aproach was to configure the maven jacoco plugin to get the argument, and then hard-coded the property into pom.xml since the property generated by the plugin is not passed to the Surefire plugin.