title: Maven Eclipse multi-module shaded dependency
body: <p>In a multi-module Maven project, one of the modules is a shaded module (e.g. no source, but generates a <code>jar</code> during <code>package</code> phase).  Other modules reference this module as a dependency (all under same parent).  Is there a way to have Eclipse recognize the shaded module as a dependency? Eclipse only covers up to <code>compile</code>. </p>
  
  <p>Currently it works on the command line (since <code>package</code> is run), but in Eclipse it shows errors. </p>
  
  <p>I have not been able to find a solution to this.</p>
  
  <p>Details:</p>
  
  <pre><code>- Parent project
     - Module A
     - Module B
  </code></pre>
  
  <p>Module A is a shaded module meaning it has something like:</p>
  
  <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-shade-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;shade&lt;/id&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;shade&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;relocations&gt;
                              &lt;relocation&gt;
                                  &lt;pattern&gt;com.third.party&lt;/pattern&gt;
                                  &lt;shadedPattern&gt;my.shaded.third.party&lt;/shadedPattern&gt;
                              &lt;/relocation&gt;
                          &lt;/relocations&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>Module B has Module A as a dependency (under dependencies-dependency). Module B tries to use classes from Module A by importing the relocated paths ...e.g:</p>
  
  <pre><code>import my.shaded.third.party.Foo;
  </code></pre>
  
  <p>This doesn't work because it can't find Foo.  This makes sense since only compile phase is run in Eclipse build.</p>