GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing pmd.github.io — Maven PMD Plugin | PMD Source Code Analyzer
Release date: 28-December-2026
Maven PMD PluginTable of ContentsMaven 3Running the pmd pluginChoosing the plugin versionWhen adding the maven-pmd-plugin to your pom.xml, you need to select a version. To figure out the latest available version, have a look at the official maven-pmd-plugin documentation. As of September 2026 (7.28.0), the current plugin version is 3.28.0. The version of the plugin should be specified in When defining the version in the pluginManagement section, then it doesn’t need to be specified in the normal plugins section. However, it should additionally be specified in the reporting section. More information, see Guide to Configuring Plugin-ins. Generating a project reportTo include the PMD report in the project reports section add the following lines under the reports element in your pom.xml: This will add an entry to the ‘project reports’ section with the PMD report when you build the maven site. Executing PMD manuallyTo run PMD on a Maven project without adding it as a report, simply run The PMD plugin writes the report in XML which will then be formatted into more readable HTML. Integrated into the build processYou can also run PMD automatically when building your project. You even let the build fail, if
PMD finds some violations. Therefore the This will run PMD automatically during the CustomizationChanging rulesetsTo specify a ruleset, simply edit the previous configuration: The value of the ‘ruleset’ element can either be a relative address, an absolute address or even an url. A clean strategy for customizing which rules to use for a project is to write a ruleset file. In this file you can define which rules to use, add custom rules, and customizing which rules to include/exclude from official rulesets. More information on writing a ruleset can be found here. Note that if you include other rulesets in your own rulesets, you have to be sure that the plugin will be able to resolve those other ruleset references. Enabling Incremental AnalysisWhen using the Maven PMD plugin 3.8 or later along with PMD 5.6.0 or later, you can enable incremental analysis to speed up PMD’s execution while retaining the quality of the analysis. You can additionally customize where the cache is stored:: Other configurationsThe Maven PMD plugin allows you to configure CPD, targetJDK, and the use of XRef to link the report to html source files, and the file encoding: Upgrading the PMD version at runtimeThe Maven PMD plugin comes with a specific PMD version, which is documented on the plugin project page. Given that the newer PMD version is compatible, you can override the PMD version, that the Maven plugin will use and benefit from the latest bugfixes and enhancements: Using PMD 7 with maven-pmd-pluginSince version 3.22.0 (MPMD-379), maven-pmd-plugin uses by default now PMD 7.0.0 and no extra configuration is required. The specific PMD version used by maven-pmd-plugin might change. The exact version is documented on the plugin project page. In order to use newer versions of PMD 7, you can simply follow the guide Upgrading PMD at Runtime. Note: If you upgrade from Maven PMD Plugin before 3.22.0 you are most likely updating from PMD 6 to PMD 7. This upgrade is a major version change. If you use the default ruleset from Maven PMD Plugin, then everything should just work. But if you use a custom ruleset, you most likely need to review your ruleset and migrate it to PMD 7. Rules might have been renamed or replaced. See Detailed Release Notes for PMD 7 and Migration Guide for PMD 7. As PMD 7 revamped the Java module, if you have custom rules, you need to migrate these rules. See the use case I’m using custom rules in the Migration Guide. Complete ExampleSee https://github.com/pmd/pmd-examples/tree/main/maven/simple-project. ReferenceFor more information, please see the well documented PMD plugin project page here: http://maven.apache.org/plugins/maven-pmd-plugin/index.html. Also, the bug tracker for this plugin is MPMD. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |