DarVar
DarVar

Reputation: 18124

How do I configure JaCoCo with Sonar

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

Answers (3)

Alberto Grande
Alberto Grande

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

Dennis S.
Dennis S.

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

Related Questions