title: How to exclude a file for checking in PMD maven pom.xml file?
body: <p>As per what I saw in the documentation it tells to use <code>&lt;exclude-pattern&gt;&lt;/exclude-pattern&gt;</code> tag for excluding some files (or packages) in the project for checking. But it does not seems to work me. I even tried the maven <code>&lt;excludes&gt;&lt;/excludes&gt;</code> but it seems to create problem for other part of the project. So what is the ideal way to exclude a file for PMD maven check?</p>
  
  <p>One of the configuration which I used in pom.xml to exclude example is as follows but it does not seems to work :-</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;rulesets&gt;
          &lt;exclude-pattern&gt;.*/example/*.*&lt;/exclude-pattern&gt;
          &lt;ruleset&gt;${project.basedir}\ruleset\basic.xml&lt;/ruleset&gt;
          &lt;!-- ruleset&gt;${project.basedir}\ruleset\braces.xml&lt;/ruleset&gt;
          &lt;ruleset&gt;${project.basedir}\ruleset\design.xml&lt;/ruleset&gt;
          &lt;ruleset&gt;${project.basedir}\ruleset\controversial.xml&lt;/ruleset&gt;
          &lt;ruleset&gt;${project.basedir}\ruleset\coupling.xml&lt;/ruleset&gt;
          &lt;ruleset&gt;${project.basedir}\ruleset\clone.xml&lt;/ruleset&gt;
          &lt;ruleset&gt;${project.basedir}\ruleset\comments.xml&lt;/ruleset--&gt;
      &lt;/rulesets&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>You might be seeing that only first  rule is being used for checking and other are commented. That is because I am seeing a weird issue in which the build failure happens when only first rule is included but the build passes if all other rules are included along the first one.</p>