Following errors we are getting.
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar (default-cli) on project timatic-security-aggregator: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Project Code: Java 11
Below is my Pipeline template
- ${{ if eq(parameters.sonarEnable, ‘true’) }}:
-
task: SonarQubePrepare@6
inputs:
SonarQube: ${{ parameters.sonarQubeEndpoint }}
scannerMode: ‘Other’
extraProperties: |
sonar.projectKey=${{ parameters.sonarProjectKey }}
sonar.host.url=$(sonarHostURL)
sonar.login=${{ parameters.sonarLogin }}
sonar.coverage.jacoco.xmlReportPaths=${{ parameters.sonarCoverageJacocoXmlReportPaths }}
sonar.exclusions= ${{ parameters.sonarExclusions }}
sonar.java.source=11 -
task: Maven@3
inputs:
mavenPomFile: ‘pom.xml’
goals: ${{ parameters.mavenGoal }}
publishJUnitResults: true
testResultsFiles: ‘**/surefire-reports/TEST-*.xml’
javaHomeOption: ‘JDKVersion’
jdkVersionOption: ‘1.11’
mavenVersionOption: ‘Default’
mavenOptions: ‘-Xmx3072m $(mavenOpts)’
mavenAuthenticateFeed: true
effectivePomSkip: false
sonarQubeRunAnalysis: ${{ parameters.sonarEnable }}
sqMavenPluginVersionChoice: ‘latest’
checkStyleRunAnalysis: true
pmdRunAnalysis: true -
${{ if eq(parameters.sonarEnable, ‘true’) }}:
- task: SonarQubePublish@6
inputs:
pollingTimeoutSec: ‘600’ - task: sonar-buildbreaker@8
inputs:
SonarQube: ${{ parameters.sonarQubeEndpoint }}
- task: SonarQubePublish@6
-