Code coverage starts to be 0% and quality gates are failing due to this

  • Sonarqube - 7.9.1, sonar-maven-plugin:3.9.0, amazon corretoo jdk 11
  • After updating jdk from 8 to amazon corretto 11 we started facing with issue when quality gates are failing due to code coverage 0%.

Even when we used jdk8, from time to time code covegare was 0% because there was no new code. But quality gates were not failing.

Added @{argLine} --illegal-access=permit to maven-surefire-plugin

Hi,

Welcome to the community!

First, your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.9.1 → 8.9.3 → 9.1 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

Once you’ve accomplished the upgrade, we can take up the issue of coverage. But I suspect it lies outside of analysis since the JDK you run analysis with shouldn’t have any impact on the reading of your coverage reports.

 
Ann

Hi Ann, thanks for the response and advice. We will work on the upgrade.
Btw we managed to fix the issue by reconfiguring maven-surefire-plugin with:

            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <argLine>@{argLine} --illegal-access=permit</argLine>
            </configuration>

It was like:

                <argLine>
                    --illegal-access=permit
                </argLine>
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.