Well, I am trying to set code coverage for RichFaces project consisting of a lot of modules. The way I've chosen is
- execute tests with code coverage in each module using jacoco-maven-plugin -> this generates jacoco.exec file for each module
- combine jacoco.exec files to one HTML report using org.jacoco.ant.jar - this part is tricky, because you need to have access to
- *.java source files
- *.class compiled files
Jacoco in indeed the way to go: it provides coverage report without needing instrumentation and then without adding steps to build process. It is just about setting a -Djava.agent system property. No effect is visible on performance.
About reports, there are 3 ways to get some, AFAIK:
* Using the Ant task to generate HTML reports
* Using EclEmma Eclipse plugins to see reports in your IDE and editor
* Using Sonar, which supports jacoco.exec files to integrate reports in its quality report dashboard. http://www.sonarsource.org/
IMHO the best way to go for JBoss is to set up a Sonar instance (Sonar is a quality analysis and reporting tools, well integrated with Jacoco, Jenkins and Maven - able to report coverage, checkstyle, findbugs...). It is a really useful tools for developers and really helps in improving code and fighting technical debt.
And since version 0.5.6 jacoco-maven-plugin can be used together with maven-site-plugin.
It will be available in the next version of Arquillian Jacoco Extension:
A very nice step ahead for usage of Jacoco would be the Jenkins-Jacoco plugin to see Jacoco reports in Jenkins:
https://issues.jenkins-ci.org/browse/JENKINS-10835 -> You can vote for this issue, hoping it will motivate Jenkins guys.
Perhaps having even more weight than voting on the issue, there is an open GSoC proposal in the JBoss Community that involves fixing this plugin.
"Add a solution for creating series of snapshots of Java coverage data over time, so the developer can track the code coverage trends and have more information about the project. Currently the Jenkins plugin is not ready. I would like to make some improvements to bring the software to a more stable version and to finish the switching from the Emma plugin."
I've put in my vote for the project to move forward, but we'll find out if it makes the cut in a week or so.
The Google Summer of Code about Jacoco reports in Jenkins was accepted: http://www.google-melange.com/gsoc/project/google/gsoc2012/ognjen/25001
It will be done by Ognjen Bubalo and is mentored by Jonathan Fuerth.
A dedicated mailing-list will appear soon, I'll post the link.
So as Mickael said, we created a mailing list.
The Mailing list: firstname.lastname@example.org
Please join us!