I want to exclude a single PMD rule in POM, but it is not working. I have tried creating a pmd-exclude.xml (in the same dir as the pom.xml):
<?xml version="1.0"?>
<ruleset name="remove_rules">
<description>Remove rules</description>
<rule ref="rulesets/unnecessary.xml">
<exclude name="UselessParentheses"/>
</rule>
</ruleset>
From http://www.ing.iac.es/~docs/external/java/pmd/howtomakearuleset.html and referenced it in pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<sourceEncoding>utf-8</sourceEncoding>
<rulesets>
<ruleset>${pom.basedir}/pmd-exclude.xml</ruleset>
</rulesets>
</configuration>
</plugin>
But it keeps reporting these rules.
Also: I do not want to specify which rules it must check, as newer versions can (and will) include new ones and I do not want to check which new rules will run in every new version.