This is the error message getting when the maven verify command is executed from azure pipeline Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594:sonar: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I am expecting my code should get built and should be successfully analyzed when calling the sonarcloud from the azure pipeline
You can upgrade your JDK to JDK11 or downgrade SonarQube to 8.9. To use JDK11 in the DevOps pipeline, you can try the suggestions below.
Ubuntu 20.04orUbuntu 22.04to run your pipeline. The default version of Java JDK is11.0.21+9. See the software in the images.javaHomeOption: 'JDKVersion'andjdkVersionOption: '1.11'.