title: How to resolve cyclic dependency in supplementary Maven sub-module?
body: <p>There is a multi-module Maven-3 project, where one of sub-modules is used as <code>&lt;dependency&gt;</code> in all other modules. At the same time, all sub-modules inherit from parent module. Such a structure leads to cyclic dependency. How can I resolve it?</p>
  
  <p>Project structure is rather typical:</p>
  
  <pre><code>/foo
    /foo-testkit
    /foo-core
  </code></pre>
  
  <p>This is parent <code>foo/pom.xml</code>:</p>
  
  <pre><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;configuration&gt;
          &lt;configLocation&gt;checkstyle/checks.xml&lt;/configLocation&gt;
        &lt;/configuration&gt;
        &lt;dependencies&gt;
          &lt;dependency&gt;
            &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
            &lt;artifactId&gt;foo-testkit&lt;/artifactId&gt;
            &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;/dependency&gt;
        &lt;/dependencies&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;phase&gt;prepare-package&lt;/phase&gt;
            &lt;goals&gt;
              &lt;goal&gt;check&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
  [...]
  </code></pre>
  
  <p>In parent <code>foo/pom.xml</code> I specify how and when checkstyle plugin has to be executed in every sub-module. But I don't need checkstyle to be executed in <code>foo-testkit</code>, which is a sub-module inheriting from <code>foo</code>, but is at the same time a dependency..</p>