PMD ruleset file

Nisha picture Nisha · Apr 20, 2011 · Viewed 32.4k times · Source

I am trying to figure where is the default ruleset file, name of the default ruleset file and how do we add our own rules to it. I tried to google, but that is just confusing me. So far, I have put the pmd plugin inside eclipse plugins folder and in preferences I can see PMD.

Answer

lschin picture lschin · Apr 21, 2011

The standard ruleset file is *.xml inside pmd-bin-x.x.x.zip/.../lib/pmd-x.x.x.jar/rulesets/, refer to http://pmd.sourceforge.net/rules/index.html.

The default ruleset file of PMD Eclipse Plugin is inside pmd___.jar in your {IDE}/plugins/..., but you should not make any changes in that file. Add/edit the rules in Eclipse Preferences, any changes will take precedence over the default ruleset.