title: Maven inherit checkstyle from parent
body: <p>I have a <b>parent POM</b> with this checkstyle configuration:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;checkstyle.configLocation&gt;src/checkstyle/checkstyle.xml&lt;/checkstyle.configLocation&gt;
      &lt;checkstyle.suppressionsLocation&gt;src/checkstyle/checkstyle-suppressions.xml&lt;/checkstyle.suppressionsLocation&gt;
      &lt;maven-checkstyle-plugin.version&gt;2.17&lt;/maven-checkstyle-plugin.version&gt;
  &lt;properties&gt;
  
  &lt;build&gt;
      &lt;pluginManagement&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;${maven-checkstyle-plugin.version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;skip&gt;true&lt;/skip&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;validate&lt;/id&gt;
                      &lt;phase&gt;validate&lt;/phase&gt;
                      &lt;configuration&gt;
                          &lt;configLocation&gt;${checkstyle.configLocation}&lt;/configLocation&gt;
                          &lt;suppressionsLocation&gt;${checkstyle.suppressionsLocation}&lt;/suppressionsLocation&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;     
          &lt;/plugin&gt;
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>And this is the <b>inherited POM</b>:</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-checkstyle-plugin&lt;/artifactId&gt;
      &lt;/plugins&gt;
      &lt;pluginManagement&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;configuration&gt;
                      &lt;configLocation&gt;${project.parent.basedir}/${checkstyle.configLocation}&lt;/configLocation&gt;
                      &lt;suppressionsFile&gt;${project.parent.basedir}/${checkstyle.suppressionsLocation}&lt;/suppressionsFile&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>I want to execute the checkstyle only in the inherited projects (because I will have multiple projects that use the parent pom). In parent project the checkstyle is not necessary to run but I have to use the <em>checkstyle.xml</em> and <em>checkstyle-suppressions.xml</em> configuration files on the parent project and use those files from inherited projects.</p>
  
  <p>This is the error obtained after <strong>mvn clean install</strong>:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (validate) on project MyProject: Failed during checkstyle execution: Unable to find suppressions file at location: src/checkstyle/checkstyle-suppressions.xml: Could not find resource 'src/checkstyle/checkstyle-suppressions.xml'. -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>The child project doesn't find the checkstyle configuration files from parent project.</p>