Sonar-scan-gradle: invalid Java version number for Java 9+ && no Java 11+ support


(Jens Gerdes) #1

Hi everyone

I am experiencing two problems with the current version of the sonar-scanner-gradle.

When triggering a scan process on a project that uses a newer JDK (9+), the scanner renders version names based upon the old versioning scheme (1.8, 1.9, 1.10…). However, versioning scheme change since Java 9 (9, 10, 11…). See:

Furthermore, the current gradle plugin does not support Java 11.

The root cause of the problem is the usage of Gradle 4.6. In a more recent version of gradle both problems have been adressed. So, please update the plugin. :slight_smile:


Update: Moved to “Report a bug”

(Julien Henry) #2

Hi Jen,

What do you mean. Are you talking about properties and collected by the scanner? AFAIK SonarJava is resilient and support both schemes.

What is the version of SonarJava in your SonarQube server? You can easily know by calling http://<your SQ server>/api/plugins/installed Recent version of SonarJava supports analyzing projects compiled with JDK 11.

What do you mean? Our plugin is a …plugin. We don’t control the version of Gradle. You can use a more recent version if it helps.

(Jens Gerdes) #3

Hi @Julien_HENRY

Yes, I am talking about the “” property. It may very well be that sonar-java accepts both schemas, however sonar-pmd currently expects the value to be in line with the JEP.

Sorry, this were two misunderstandings from my side within one paragraph.
First, I thought that the gradle scanner uses the version of class JavaVersion with which the plugin has been built. However, this seems to be a runtime dependency. :sweat_smile:
Second, gradle only changed the versioning scheme according to the above mentioned JEP for JavaVersion 11, not the older one. Using amore recent gradle version will therefore have no effect on the value of “” for Java versions < Java 11.

To sum up, the scanner plugin is fine. It’s my plugin, sorry. :sweat_smile: