Reputation: 18124
How do I configure JaCoCo with Sonar 2.3 and Maven 3.0.4?
My project is a multi-module Maven project. My top level pom has the following:
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
After running mvn sonar:sonar I am getting 0% Code Coverage reported in Sonar. I should be seeing at least 50%. Note I do see the jacoco.exec in the target folder of each child project.
Upvotes: 2
Views: 10556
Reputation: 29
They have modified the GitHub project structure. New link with the examples is:
https://github.com/SonarSource/sonar-examples/tree/master/projects/languages/java/code-coverage/ut
Upvotes: 1
Reputation: 2121
Consider upgrading Sonar - the current version is 3.2, and has JaCoCo as it's native code coverage module.
Also, see https://github.com/SonarSource/sonar-examples/tree/master/projects/code-coverage/ut for lots of examples
Upvotes: 1
Reputation: 1663
Hi there are some very interesting articles describing exactly your case. Here's the list http://www.sonarsource.org/measure-coverage-by-integration-tests-with-sonar-updated/ http://johndobie.blogspot.gr/2011/06/maven-multi-module-with-sonar-and.html http://johndobie.blogspot.gr/2011/06/seperating-test-code-coverage-with.html And one relevant question Jacoco and Sonar code coverage? Hope you find them useful
Upvotes: -1