title: Override dependencies in a maven plugin (one plugin, different modules and different dependencies)
body: <p>I have a java project which has more modules. In some of the modules I use a plugin.
  In that plugin I nee to override one from its dependencies. So far so good. Solved with adding of the desired dependency in the plugin definition.</p>
  
  <pre><code>&lt;plugin&gt;
     &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
     &lt;artifactId&gt;xdoclet-maven-plugin&lt;/artifactId&gt;
     &lt;version&gt;1.0&lt;/version&gt;
     &lt;dependencies&gt;
        &lt;dependency&gt;
           &lt;groupId&gt;xdoclet&lt;/groupId&gt;
           &lt;artifactId&gt;xjavadoc&lt;/artifactId&gt;
           &lt;version&gt;1.5-SNAPSHOT&lt;/version&gt;
         &lt;/dependency&gt;
     &lt;/dependencies&gt;
     ...
  </code></pre>
  
  <p>But in one of the modules I need to override that dependency with some other version. I tried to solve that with the same way as overriding.
  If I compile only that submodule alone, the correct dependency version is used, but if I compile whole project it does not work, because it uses the dependency from other modules for the plugin and not the one specified in the modules pom. </p>
  
  <p>Any idea how to solve my problem?</p>
  
  <p>Best regards, Filip</p>