title: Share specific PMD rulesets across multi module maven project
body: <p>I'm trying to share the same pmd configuration across all my submodules. I'm looking for the best way to achieve that</p>
  
  <p>I thought that I could place it in the parent project, like I did it for checkstyle plugin </p>
  
  <h2>Parent pom.xml</h2>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-checkstyle-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.9.1&lt;/version&gt;
              &lt;configuration&gt;
                   &lt;configLocation&gt;/src/main/config/checkstyle.xml&lt;/configLocation&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &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;2.7.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;rulesets&gt;
                      &lt;ruleset&gt;pmd.xml&lt;/ruleset&gt;
                  &lt;/rulesets&gt;
                  &lt;linkXref&gt;true&lt;/linkXref&gt;
                  &lt;sourceEncoding&gt;${project.build.sourceEncoding}&lt;/sourceEncoding&gt;
                  &lt;targetJdk&gt;${maven.compiler.target}&lt;/targetJdk&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <h2>Multi Module Structure</h2>
  
  <p>Here my structure</p>
  
  <pre class="lang-xml prettyprint-override"><code>parent
  |-- src
  |   `-- main
  |       `-- resources
  |           |-- pmd.xml
  |           `-- checkstyle.xml
  |-- pom.xml
  |-- model
  |   `-- pom.xml
  `-- webapp
      `-- pom.xml
  </code></pre>
  
  <h2>Error</h2>
  
  <p>With this configuration, I only obtain the following error : </p>
  
  <pre class="lang-xml prettyprint-override"><code> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:2.7.1:pmd (default-cli) on project model: An error has occurred in PMD Report report generation. Could not find resource 'pmd.xml'. -&gt; [Help 1]
  </code></pre>
  
  <h2>Solution 1</h2>
  
  <p>I tried this solution that works for me, because I only have one level on submodules : 
  But in a close future, I may have more levels, so I'm not convinced that's THE method
                                     ${basedir}/../src/main/resources/pmd.xml</p>
  
  <h2>Solution 2</h2>
  
  <p>Without writing all the solution, I can use an assembly to zip my config and use it in all my submodule as an dependency. This would work for any levels, but this is overkilling !</p>
  
  <p>Here a link that would explain it: <a href="https://stackoverflow.com/questions/10828754/how-to-include-resources-from-war-to-another-maven-project/10887695#10887695">How to include resources from war to another maven project</a></p>
  
  <p>So I'm looking for a Maven trick, but I don't what or how ! Every advice / clue is welcome.</p>