SonarQube Reading Becomes 0 after upgrading from Java 8 to 11

168 Views Asked by At

I recently upgraded my project from Java 8 to 11. For the dependency of Jacoco, i upgraded jacoco-maven-plugin from version 0.7.6.201602180812 to 0.8.7

After that, my Sonar code coverage becomes 0. Below is a part of my pom.xml related to my jacoco build and pluginmanagement

Build Plugins

pluginManagement

I keep on changing the Jacoco version, thinking that I'm not using the best version for Java 11 that's why the Sonar report are not generated, but still failed to resolved the issue.

1

There are 1 best solutions below

2
On
  • Try changing ${argLine} to @{argLine}, this format allows for late replacement of properties in surefire. This might be the fix for Java 11, JaCoCo and surefire compatibility. Read about late replacement and JaCoCo here
  • Try downgrading JaCoCo to version 0.8.3. In my experience Java 11 was not compatible with any version above 0.8.3.