Custom Plugin with Java Checks is not started by SonarQube Server

Hello,

we are currently developing a SonarQube Plugin with custom checks with Java by following this guide.

The Version of our SonarQube Server is 9.9.1 (build 69595) and the working versions of “sonar-plugin-api” and “sonar-java-plugins” can be seen in the pom snippet:

		<sonar.version>9.9.1.69595</sonar.version>
		<sonar.plugin.api.version>9.7.0.160</sonar.plugin.api.version>
		<sonar.java.plugin.version>7.14.0.30229</sonar.java.plugin.version>
		<analyzer.commons.version>2.1.0.1111</analyzer.commons.version>

Now I want to upgrade the “sonar-java-plugin”-version to at least 7.17 to use the newly introduced tokens for records. But with the following versions it does not work:

		<sonar.version>9.9.1.69595</sonar.version>
		<sonar.plugin.api.version> 9.16.0.560</sonar.plugin.api.version>
		<sonar.java.version>7.18.0.31443</sonar.java.version>
		<analyzer.commons.version>2.1.0.1111</analyzer.commons.version>

The compatible “sonar-plugin-api”- version I took from the mapping in the repo. Since there is no info regarding “sonar-java-plugin”-version, I just took 7.18.0.31443.

But when copying the built JAR to the plugins folder of my server and restarting it, apparently my plugin with custom rules is not started. I guess there are some version incompatibilities, I’m not aware of.

Can anyone help?

Thank you in advance!

Hi @nhu_duc,

Thank you for engaging with the community.
If you take a closer look at the guide, you will notice the following:

Looking inside the pom, you will see that both SonarQube and the Java Analyzer versions are hard-coded. This is because SonarSource’s analyzers are directly embedded in the various SonarQube versions and are shipped together. For instance, SonarQube 8.9 (previous LTS) is shipped with version 6.15.1.26025 of the Java Analyzer, while SonarQube 9.9 (LTS) is shipped with a much more recent version 7.16.0.30901 of the Java Analyzer. These versions can not be changed .

To use the latest sonar-java-plugin, you need to update the SonarQube version.

Please note that in the first pom snippet, you used sonar.java.plugin.version, and in the second, sonar.java.version.

I hope this helps!

All the best,

Irina