Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Depending on the code coverage tool you used to generate your report, replace jacoco by emmacobertura or clover in the property name. 

Blog

See also the Manage Code Coverage by Unit Tests with Sonar blog post.

FAQ

0% code coverage reported whereas unit tests are correctly executed

This problem occurs while using the Maven Cobertura Plugin and a special configuration of the Maven Surefire Plugin preventing unit tests to be forked. This problem can be solved by removing the line "<forkMode>never</forkMode>" in the Maven configuration file (see SONAR-1445 and MCOBERTURA-70).