Sonar cloud Java version warning with sonar-maven-plugin

  • ALM used (Bitbucket Cloud)
  • CI system used (Bitbucket Cloud)
  • Scanner command used - mvn -B verify -s settings.xml org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
  • Languages of the repository - Java

I have a java repository in Bit-bucket and using Sonar-maven-plugin to analyze the code using SonarCloud. As given above , i am using sonar-maven-plugin without specifying the version i.e. latest sonar-maven-plugin is being used. But still in my sonarcloud project there is below warning. Kindly help me to resolve this warning.

Last analysis has warnings
The version of Java (16) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here
  • Snippet from bitbucket-pipelines.yml related to sonar is given below
image: maven:3.6.1
  depth: full    # SonarCloud scanner needs the full history to assign issues properly
    sonar: ~/.sonar/cache  # Caching SonarCloud artifacts will speed up your build

 - step: &sonar
        name: Build, test and analyze on SonarCloud
          - maven
          - sonar
          - mvn -B verify -s settings.xml org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

Hey there.

You probably just need to bump this up as Java 17 wasn’t released

Is there a specific reason you’re pinning to 3.6.1? Maybe you copied it from a tutorial somewhere? If there’s no specific reason, I would suggest using one like image:3-eclipse-temurin-17 or another flavor that supports Java 17.