How can I know against which version of Java SonarQube validates the code? Is it the version of the JVM? What then if my project is based on a different version?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I do confirm that this property sonar.java.source is used only by the PMD tool. The SonarSource's Java analyser uses a superset grammar and so can analyse source files regardless of the Java version they comply to.
The default value is 1.5.
To set the appropriate version, you need to set
sonar.java.source
property to tellPMD
which version of Java your source code complies to.Possible values: 1.4, 1.5 or 5, 1.6 or 6, 1.7 or 7. Since version 2.2 of the plugin, this property can also be set to 1.8 or 8.
If you're using the ant task, just add:
If you're using the SonarRunner, just add the line below to the file
<install_directory>/conf/sonar-runner.properties
: