title: Maven Multi Module Project breaking compile-time class resolution
body: <p>I've been previously managing a 3-module project as 3 seperate maven projects. As this project has been moving forward, I decided I ought to take advantage of the dependency management of maven2 to streamline integration between these 3 evolving modules.</p>
  
  <p>I defined a super-project that deploys as POM. Some shared dependencies are defined here, and the modules are defined in the POM in the order of dependency from the least dependent module to the most dependent module. Each module has a POM definition back to the parent, and where it applies there are dependencies from one module to the deployed artifact of another module. I'll include possibly worthwhile pom.xml lines at the end.</p>
  
  <p>On to the problem, I setup this project yesterday and was able to get each module building and working on its own. I then come back today to work on one of the modules now that some fresh requirements have come in and all of sudden everything is breaking. I'm editing the projects in Eclipse, and each time I modify a file, it no longer can resolve any of the classes defined within the same project. That is to say if I have a class foo.bar.class1 and it has an object of foo.bar.class2, Eclipse (and the compiler at large) complains that it cannot resolve class foo.bar.class2... Now this is blowing my mind because this other class is in the same project and package. Similar issues are also present for classes not in the same package.</p>
  
  <p>Is there something broken in my maven setup, or does anyone have any idea why these projects can't even resolve classes in the same package??</p>
  
  <p>-::POMs::-</p>
  
  <p>Parent -> /path/to/project/mainApp</p>
  
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
  &lt;artifactId&gt;mainApp&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  &lt;name&gt;Main App&lt;/name&gt;
  
  &lt;modules&gt;
      &lt;module&gt;Broker&lt;/module&gt;
      &lt;module&gt;Soap&lt;/module&gt;
      &lt;module&gt;UI&lt;/module&gt;
  &lt;/modules&gt;
  </code></pre>
  
  <p>Broker -> /path/to/project/mainApp/Broker</p>
  
  <pre><code> &lt;parent&gt;
     &lt;artifactId&gt;mainApp&lt;/artifactId&gt;
     &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
     &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
     &lt;relativePath&gt;../&lt;/relativePath&gt;
   &lt;/parent&gt;
  
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
   &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
   &lt;artifactId&gt;Broker&lt;/artifactId&gt;
   &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
  </code></pre>
  
  <p>Soap -> /path/to/project/mainApp/Soap</p>
  
  <pre><code>&lt;parent&gt;
    &lt;artifactId&gt;mainApp&lt;/artifactId&gt;
    &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;relativePath&gt;../&lt;/relativePath&gt;
  &lt;/parent&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
  &lt;artifactId&gt;SOAP&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  
  ...
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
      &lt;artifactId&gt;Broker&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;type&gt;jar&lt;/type&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  
  ...
  </code></pre>
  
  <p>UI -> /path/to/project/mainApp/UI</p>
  
  <pre><code>&lt;parent&gt;
    &lt;artifactId&gt;mainApp&lt;/artifactId&gt;
    &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;relativePath&gt;../&lt;/relativePath&gt;
  &lt;/parent&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
  &lt;artifactId&gt;UI&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  
  ...
  
  
  &lt;dependency&gt;
    &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
    &lt;artifactId&gt;SOAP&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.moremagic&lt;/groupId&gt;
    &lt;artifactId&gt;Broker&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;type&gt;jar&lt;/type&gt;
    &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  
  ...
  </code></pre>