I'm attempting to exclude a certain rule from pmd using the maven-pmd-plugin (in a multi-module maven project).
Approach:
Using the excludeFromFailureFile http://maven.apache.org/plugins/maven-pmd-plugin/examples/violation-exclusions.html
Ideally, I want to exclude this rule for the entire product (based on a parent package), however,to being with I tested for a particular class - even that is not working.
Environment
Java 7, Maven 3.0.3
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>3.1</version> <executions> <execution> <goals> <goal>check</goal> </goals> <configuration> <excludeFromFailureFile>exclude-pmd.properties</excludeFromFailureFile> </configuration> </execution> <execution> <goals> <goal>cpd-check</goal> </goals> <!-- Added explicit execution Id to avoid the below problem --> <!-- 'build.pluginManagement.plugins.plugin[org.apache.maven.plugins:maven-pmd-plugin].executions.execution.id' must be unique but found duplicate execution with id default @ line 1423, column 36 --> <id>cpd-check</id> </execution> </executions>
Contents of exclude-pmd.properties
mycompany.project.classA=UselessParentheses