Customizing PMD rules
PMD allows you to perform code static analysis for your project, but sometimes the default doesn’t fit the way you decided to write code. The good thing is that you can customize the rules you want to use to fit your preferences.
To customize the rules you will need to create an xml file with this structure:
1
2
3
4
5
6
7
<?xml version="1.0"?>
<ruleset name="Custom ruleset"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>Rules for my project</description>
</ruleset>