SonarQube Java version for code verification

How can I find out which version of Java SonarQube checks the code? Is this a version of the JVM? What if my project is based on a different version?

+6
source share
2 answers

I confirm that this sonar.java.source property is used only by the PMD tool. The SonarSource Java Analyzer uses a superset grammar and therefore can parse source files regardless of the version of Java they correspond to.

+2
source

The default value is 1.5.

To install the appropriate version, you need to set the sonar.java.source property to tell PMD which version of Java your source code corresponds to.

Possible values: 1.4, 1.5 or 5, 1.6 or 6, 1.7 or 7. Starting with version 2.2 of the plugin, this property can also be set to 1.8 or 8.

If you are using the ant task, just add:

  <property name="sonar.java.source" value="${javaversion}"/> 

If you are using SonarRunner , just add the line below to the <install_directory>/conf/sonar-runner.properties :

 sonar.java.source=1.5 
+9
source

Source: https://habr.com/ru/post/971018/


All Articles