How to find out which version of sonar-java is on SQ install

  • SQ version: 9.9.2.77730
  • Zipped sonar

We have a custom rules plugin and want to find out which version of sonar-java is installed on SQ since we re-use methods from it to make our rules re-use code.
I also assume that we don’t need to include the sonar-java in our plugin. Is that true?

br,

//mike

Hey there.

Take a look here

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.

<properties> <sonarqube.version>9.9.0.229</sonarqube.version>
<sonarjava.version>7.16.0.30901</sonarjava.version> <!-- [...] --> </properties>

@Colin so these

<properties> <sonarqube.version>9.9.0.229</sonarqube.version>
<sonarjava.version>7.16.0.30901</sonarjava.version> <!-- [...] --> </properties>

and in example:

and these are the plugins:

 <dependency>
      <groupId>org.sonarsource.api.plugin</groupId>
      <artifactId>sonar-plugin-api</artifactId>
      <version>${sonarqube.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.sonarsource.java</groupId>
      <artifactId>sonar-java-plugin</artifactId>
      <type>sonar-plugin</type>
      <version>${sonarjava.version}</version>
      <scope>provided</scope>
    </dependency>

are the versions to use in my custom sonar rules plugin when I use version 9.9 LTS?

This is what the sonar plugin API states:

SonarQube Plugin API
9.9.0.65466 9.14.0.375

So I am consfused since we used this 9.14.0.375 as sonar version.

Is it still the version you mentioned?

br,

//mike

You should use 9.14.0.375. I will ping the right team to correct the currently confusing POM.

1 Like

It is done: the pom is updated.

1 Like