Scanning failing using Java version 17

  • Bitbucket Cloud
  • mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey.
  • Java

The last analysis is showing warnings, that version of Java (11.0.18) is deprecated and will no longer be supported for the scanning.

Changing the JDK to version 17 and executing maven Command ‘mvn verify’ result in following Error

Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.6:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.6' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-war-plugin:2.6

Additionally, I can mention that I have already performed the same exercise in relation to changing the JDK, as my code base is only supported in Java version 8. Therefore, I have already updated my Java version to 11 prior to initiating the scanning process. And works without any challenge.


It’s quite possible that you’ll need to make other upgrades in your build to fully adopt Java 17. It sounds like the war plugin might be one of them.