GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.pmd-code.org — Making rulesets | PMD Source Code Analyzer
Release date: 28-December-2026
Making rulesetsA ruleset is an XML configuration file, which describes a collection of rules to be executed in a PMD run. PMD includes built-in rulesets to run quick analyses with a default configuration, but users are encouraged to make their own rulesets from the start, because they allow for so much configurability. This page walk you through the creation of a ruleset and the multiple configuration features offered by rulesets.
Table of ContentsCreating a rulesetThe first step is to create a new empty ruleset. You can use the following template: Referencing a single ruleTo use the built-in rules PMD provides, you need to add some references to them. Here’s a basic rule reference: Adding that element into the How to read the
Tip You can discover the available rules by language and category from this page.
Configuring individual rulesHow you can configure individual rules is described on Configuring Rules. Bulk-adding rulesYou can also reference rules in bulk by referencing a complete category or ruleset, possibly excluding certain rules, like in the following: Here, the Note Path separators in the source file path are normalized to be the Note “Referencing a complete category or ruleset means, you’ll also get automatically any changes for this ruleset. If new rules are added, then these are automatically activated for you. If rules are deprecated, then these rules are automatically deactivated. This might or not might be what you want. This can happen, if a new version of PMD provides a new rule and or deprecates existing rules. If you want to have complete control over the rules that you are using, then it is recommended to add each rule separately via a single rule reference. Filtering the processed filesYou can exclude some files from being processed by a ruleset using exclude patterns, with an optional overriding include pattern. A file will be excluded from processing when there is a matching exclude pattern, but no matching include pattern. This exclude/include technique works regardless of how PMD is used (e.g. command line, IDE, Ant), making it easier to keep application of your PMD rules consistent throughout your environment. Here is an example: Sharing your rulesetTip If you want to share your ruleset, you can add it to the list
Tags:
getting_started
userdocs
|
| 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. |