Sonar-PMD is a plugin that provides coding rules from PMD.
For a list of all rules and their status, see: RULES.md
The plugin is available in the SonarQube marketplace and should preferably be installed from within SonarQube (Administration --> Marketplace --> Search pmd).
Alternatively, download the latest JAR file, put it into the plugin directory (
./extensions/plugins) and restart SonarQube.
Usage should be straight forward:
- Activate some PMD rules in your quality profile.
- Run an analysis.
Sonar-PMD analyzes the given source code with the Java source version defined in your Gradle or Maven project. In case you are not using one of these build tools, PMD uses the default Java version - which is 1.6.
If that does not match the version you are using, set the
sonar.java.source property to tell PMD which version of Java your source code complies to.
- 1.5 or 5
- 1.6 or 6
- 1.7 or 7
- 1.8 or 8
Description / Features
|Max. supported Java Version||1.7||1.8||1.8||11||15|
|Min. SonarQube Version||4.5.4||4.5.4||6.6||6.7|
A majority of the PMD rules have been rewritten in the Java plugin. Rewritten rules are marked "Deprecated" in the PMD plugin, but a concise summary of replaced rules is available.
Rules on test
PMD tool provides some rules that can check the code of JUnit tests. Please note that these rules (and only these rules) will be applied only on the test files of your project.
Sonar-PMD is licensed under the GNU Lesser General Public License, Version 3.0.