Fix Sonar scan: remove stale sonar-maven-plugin override - #299
Merged
Conversation
The `sonar` profile pinned sonar-maven-plugin to 3.9.1.2184, overriding
the 5.5.0.6356 declared in the top-level properties. Since the CI Sonar
step activates `-Psonar`, the ancient scanner was the one actually
running, and it fails on Java 17 now that SonarQube Cloud requires
Java 21 or newer:
Java 17 is not supported. Please upgrade to Java 21 or newer, or use
JRE auto-provisioning to keep this requirement always up to date.
Scanner 5.5 runs on Java 17 and auto-provisions a JRE for the analysis
engine, so the workflow can keep using `setup-java: 17`.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
The Sonar scan step fails in CI (e.g. on #298):
Cause
pom.xmldeclares<sonar-maven-plugin.version>5.5.0.6356</sonar-maven-plugin.version>in thetop-level properties, but the
sonarprofile overrode it back to3.9.1.2184. The CI Sonar stepruns with
-Psonar, so the ancient scanner was the one actually used — and 3.9.1 has no JREauto-provisioning, so it fails outright now that SonarQube Cloud requires Java 21 or newer.
Fix
Drop the override so the
sonarprofile uses the 5.5.0.6356 already declared at the top of the pom.Scanner 5.5 runs on Java 17 and auto-provisions a JRE 21 for the analysis engine, so
setup-java: 17indeploy.ymlcan stay as is.Verification
mvn -Psonar help:evaluate -Dexpression=sonar-maven-plugin.version→5.5.0.6356mvn -Psonar sonar:sonarlocally under JDK 17 against an unreachable host: it loadssonar-maven-plugin:5.5.0.6356, logsJava 17.0.20 Ubuntu (64-bit)and reaches serverbootstrapping (failing only on the deliberate connection error) — no "Java 17 is not supported".