We’re running into an issue with SonarCloud when re-scanning our Java project. We’re performing local scans and pushing reports to SonarCloud using the following Maven command:
Blockquote
mvn clean install -DskipTests sonar:sonar -Dsonar.projectKey=sample_${SONAR_PROJECT_KEY} -Dsonar.organization=${SONAR_ORG} -Dsonar.branch.name=${BITBUCKET_BRANCH} -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=${SONAR_TOKEN} -Dsonar.scm.relativeFiles=true
This command works fine initially, and we can see the reports on SonarCloud. However, when new code is pushed to the same branch and we re-run the command, the SonarCloud dashboard shows a failed status with an error: “Uncovered Lines on New Code.”
Interestingly, if we delete the project in SonarCloud and re-run the scan, it passes without issues. But any subsequent code changes and scans trigger the same “Uncovered Lines on New Code” error again.
Has anyone encountered this issue before? Any insights on what might be causing this or how to resolve it? Could it be related to the command configuration, branch settings, or something else in SonarCloud?
Thanks in advance for your help!