Fail to scan on Azure pipeline: Java11 is deprecated

hi @Alexandre_Gigleux @ganncamp @daniel - While running maven build through azure pipeline started getting the error
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project abc:
[ERROR]
[ERROR] The version of Java (11.0.21) used to run this analysis is deprecated, and SonarCloud no longer supports it. Please upgrade to Java 17 or later.
[ERROR] As a temporary measure, you can set the property ‘sonar.scanner.force-deprecated-java-version’ to ‘true’ to continue using Java 11.0.21
[ERROR] This workaround will only be effective until January 28, 2024. After this date, all scans using the deprecated Java 11 will fail.

Please let us know what has to be updated in order to continue the code running on Java 11.
Will there any change in report that will be seen on sonar scanner end after analysis of project

Hey there.

Take a look at the documentation on scanner environment, specifically the section on Maven.

Maven / Gradle

If your whole Maven or Gradle build doesn’t run on Java 17, we suggest first to try to base the whole build on one of those versions of Java. If it’s not compatible, then you can override the JAVA_HOME environment variable just before the analysis step, as shown here:

# Maven
mvn verify ...
export JAVA_HOME=/path/to/java17
mvn sonar:sonar ...

Yes tried this only and works