This is still an issue.
Step 1 : clean install using default JDK 8 which is fine (Build is successful)
Step 2: sonar:sonar -Dsonar.host.url=https://sonarqube-test/sonarqube -Dsonar.token=sqa_XXXXXXXX -Dsonar.java.jdkHome=“C:'Program Files’\Microsoft\jdk-17.0.10+7”
Error:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar (default-cli) on project my-portfolio: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar failed: Unable to load the mojo ‘sonar’ in the plugin ‘org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121’ due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/sonarsource/scanner/maven/SonarQubeMojo 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
As per the doc, I have used JDK 8 to build the code and JDK17 for sonar analysis but it is failed with the above error.
Kindly, Please advise.
I am using the below pipeline script. JDK 17 has installed, our Jenkins is running on JDK 21 and SonarQube 10.7 version bu tstill getting an error. Kindly, Please assist. Thanks in advance,
Error:
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.ex.customer:myproject:war:2.10.359.SNAPSHOT: The following artifacts could not be resolved: jdk:tools:jar:5.0: Could not find artifact jdk:tools:jar:5.0 at specified path C:\Program Files\Microsoft\jdk-17.0.10+7/…/lib/tools.jar
I am using the below pipeline script. JDK 17 has installed, our Jenkins is running on JDK 21 and SonarQube 10.7 version bu tstill getting an error. Kindly, Please assist. Thanks in advance,
Error:
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.ex.customer:myproject:war:2.10.359.SNAPSHOT: The following artifacts could not be resolved: jdk:tools:jar:5.0: Could not find artifact jdk:tools:jar:5.0 at specified path C:\Program Files\Microsoft\jdk-17.0.10+7/…/lib/tools.jar
I’ve consolidated your posts on this topic into a new thread. You’ve now resurrected two stale threads. I should have said something the first time you did it, but let it slide. My mistake.