Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add documentation for sonar.jacoco.reportMissing.force.zero

...

Code Block
	  <properties>
        <argLine>-Xmx128m</argLine>
      </properties>
...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <runOrder>random</runOrder>
        </configuration>
      </plugin>

Force coverage to 0% 

By default, when no coverage report is found, the JaCoCo plugin will not set any value for coverage metric. This behaviour can be overriden to force coverage to 0% in case of a lack of report by setting the following property : 

Code Block
sonar.jacoco.reportMissing.force.zero=true

Coverage per test 

Using some unit test listeners you can collect the information on which lines where covered by which tests and display them in SonarQube. See  the pom.xml of the sample project to configure this and see the Component Viewer documentation to display this information in SonarQube.

...