title: PMD exclude-pattern with gradle
body: <p>I'm attempting to create some exclude patterns for a PMD task in Gradle.</p>
  
  <p>My task is generated in the next way:</p>
  
  <pre><code>/* Allows generation of pmd config  */
  allprojects {
      apply plugin: 'pmd'
  }
  gradle.projectsEvaluated {
  
      subprojects.each() { project -&gt;
  
  
          if (project.hasProperty('android')) {
  
              project.task("runPmd", type: Pmd) {
  
                  description "Run pmd"
                  group 'verification'
  
                  source = fileTree("${project.projectDir}/src/main/java")
                  ruleSetFiles = files("${project.rootDir}/build-tools/pmd.xml")
                  ignoreFailures = true
  
                  reports {
                      xml.enabled = true
                      html.enabled = true
                  }
              }
  
          }
      }
  }
  </code></pre>
  
  <p>And the ruleSet is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ruleset name="MyCompany 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"&gt;
  
      &lt;description&gt;
          MyCompany ruleset for Android PMD
      &lt;/description&gt;
  
    &lt;exclude-pattern&gt;.*/org/jivesoftware/.*&lt;/exclude-pattern&gt;
    &lt;exclude-pattern&gt;.*/net/java/.*&lt;/exclude-pattern&gt;
  
  ...rules...
  &lt;/ruleset&gt;
  </code></pre>
  
  <p>But in my reports, I'm getting:
  <a href="https://i.stack.imgur.com/nl3hy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nl3hy.png" alt="Report"></a></p>
  
  <p>Am I doing something wrong? Checking <a href="https://stackoverflow.com/a/20189104/1668144">this</a> answer seems that I'm defining the <code>exclude-pattern</code> right, but pmd is analyzing those files.</p>