API incompatibility after upgrading from SonarQube 7.5 to 7.7

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 7.7, latest JavaScanner 5.12, sonar-maven-plugin
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project com.godyo.p5.parent: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin: failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin: java.lang.NoSuchMethodError: org.sonar.plugins.java.api.JavaResourceLocator.findSourceFileKeyByClassName(Ljava/lang/String;)Ljava/lang/String;
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/var/lib/jenkins/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/
[ERROR] urls[1] = file:/var/lib/jenkins/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/var/lib/jenkins/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/var/lib/jenkins/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[4] = file:/var/lib/jenkins/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/
[ERROR] urls[5] = file:/var/lib/jenkins/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>com.godyo.p4:com.godyo.p5.parent:4.5.1917-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR] -----------------------------------------------------

I already searched for any incompatible plugins etc. but i can’t see a pointer to a problematic plugin from the error message.

Any hints to solve the issues are more than welcome!

Thank you!

Bye, Peter

1 Like

I have exactly the same problem but with SonarQube 6.7.5. It showed up after I’ve updated SonarJava from 5.11 to 5.12. Maybe it’s an incompatibility between SonarJava 5.12 and sonar-maven-plugin

Do you use the SonarQube Spotbugs plugin?

It seems that it depends on a deprecated (and now removed) method from the sonar-java plugin:

Yes we use the SpotBugs Plugin. I was sure that SpotBugs Version 3.10 was listed here but I can’t see it anymore.

But the SpotBugs compatibility matrix here does mention version 7.6 but not 7.7 .

And 2 days ago someone opened an issue for this error here

Thanks anyway for the hint. Would be good to know in advance which plugin’s stop orking after upgrade :wink:

Bye, Peter

1 Like

Same error here, using Sonar 6.7.1 and SonarJava 5.12 (build 17701).

We are not using sonar-maven-plugin but do our analysis via sonarqube-ant-task.