title: Maven pmd plugin - Exclude/Disable a rule
body: <p>I'm attempting to exclude a certain rule from pmd using the maven-pmd-plugin (in a multi-module maven project).</p>
  
  <p><strong>Approach:</strong></p>
  
  <p>Using the excludeFromFailureFile
  <a href="http://maven.apache.org/plugins/maven-pmd-plugin/examples/violation-exclusions.html" rel="noreferrer">http://maven.apache.org/plugins/maven-pmd-plugin/examples/violation-exclusions.html</a></p>
  
  <p>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.</p>
  
  <p><strong>Environment</strong></p>
  
  <p>Java 7, Maven 3.0.3</p>
  
  <pre><code>&lt;plugin&gt;
         &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
         &lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;
         &lt;version&gt;3.1&lt;/version&gt;
         &lt;executions&gt;
           &lt;execution&gt;
              &lt;goals&gt;
                &lt;goal&gt;check&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;excludeFromFailureFile&gt;exclude-pmd.properties&lt;/excludeFromFailureFile&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
            &lt;execution&gt;
               &lt;goals&gt;
                   &lt;goal&gt;cpd-check&lt;/goal&gt;
               &lt;/goals&gt;
            &lt;!-- Added explicit execution Id to avoid the below problem --&gt;
        &lt;!-- '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 --&gt;
              &lt;id&gt;cpd-check&lt;/id&gt;
            &lt;/execution&gt;
     &lt;/executions&gt;
  </code></pre>
  
  <p></p>
  
  <p>Contents of exclude-pmd.properties</p>
  
  <pre><code>mycompany.project.classA=UselessParentheses
  </code></pre>