title: How to configure Eclipse to automatically resolve and build multiple maven modules?
body: <p><strong>Here is my situation:</strong></p>
  
  <ul>
  <li>I'm trying to migrate from Ant to Maven</li>
  <li>My project has 3 artifacts: <code>shared api</code> (jar), <code>web app</code> (war), <code>desktop swing app</code> (jar). Latter 2 depends on shared api.</li>
  <li>At this moment  I'm trying to make web app part work. So I've created 4 poms: <code>eftracker</code> (root pom), <code>eftracker-parent</code>, <code>eftracker-shared</code>, <code>eftracker-web</code>. </li>
  <li>If I run <code>mvn package</code> on <code>eftracker</code> all works just perfect -- I have <code>eftracker-shared.jar</code> and <code>eftracker-web.war</code> created as expected</li>
  <li>I added <code>tomcat7-maven-plugin</code>to run web app with maven goal <code>tomcat7:run</code> to test changes made during development</li>
  <li>I also added <code>eftracker-shared</code> as a project to <code>eftracker-web</code> build path.</li>
  </ul>
  
  <p><strong>My goal:</strong> </p>
  
  <ul>
  <li>Now I want to work comfortably in Eclipse, meaning I want to change files, hit Run and in couple seconds be able to test my changes.</li>
  <li>During development I will change both: shared and web projects.</li>
  </ul>
  
  <p><strong>My problem:</strong> </p>
  
  <ul>
  <li>If I never run <code>mvn install</code> than an attempt to invoke <code>tomcat7:run</code> will lead to error: <code>Failed to execute goal on project eftracker-web: Could not resolve dependencies for project com.skarpushin:eftracker-web:war:1.503.0: Could not find artifact com.skarpushin:eftracker-shared:jar:1.503.0 in central (https://repo.maven.apache.org/maven2)</code></li>
  <li>It appears I have to <code>mvn clean install</code> shared project (or even on root module) each time I change it before I can execute <code>tomcat7:run</code> on web app and see recent changes.</li>
  </ul>
  
  <p><strong>Question is:</strong> </p>
  
  <ul>
  <li>Is it possible to make this process automatic?</li>
  <li>...OR maybe there is other way how to minimize "maven overhead" during development?</li>
  </ul>
  
  <p><strong>eftracker.pom</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.skarpushin&lt;/groupId&gt;
      &lt;artifactId&gt;eftracker&lt;/artifactId&gt;
      &lt;version&gt;1.503.0&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
      &lt;name&gt;eftracker&lt;/name&gt;
  
      &lt;modules&gt;
          &lt;module&gt;eftracker-parent&lt;/module&gt;
          &lt;module&gt;eftracker-shared&lt;/module&gt;
          &lt;module&gt;eftracker-web&lt;/module&gt;
      &lt;/modules&gt;
  
      &lt;properties&gt;
          &lt;maven.deploy.skip&gt;true&lt;/maven.deploy.skip&gt;
      &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>eftracker-parent/pom.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.skarpushin&lt;/groupId&gt;
      &lt;version&gt;1.503.0&lt;/version&gt;
      &lt;artifactId&gt;eftracker-parent&lt;/artifactId&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;name&gt;eftracker-parent&lt;/name&gt;
  
      &lt;!-- ...some common properties, dependencies, build plugins... --&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>eftracker-web/pom.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.skarpushin&lt;/groupId&gt;
          &lt;artifactId&gt;eftracker-parent&lt;/artifactId&gt;
          &lt;version&gt;1.503.0&lt;/version&gt;
          &lt;relativePath&gt;../eftracker-parent&lt;/relativePath&gt;
      &lt;/parent&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;artifactId&gt;eftracker-web&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
                  &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;path&gt;/&lt;/path&gt;
                      &lt;port&gt;8080&lt;/port&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;warSourceDirectory&gt;src/main/webapp&lt;/warSourceDirectory&gt;
                      &lt;warName&gt;ROOT##${project.version}&lt;/warName&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.skarpushin&lt;/groupId&gt;
              &lt;artifactId&gt;eftracker-shared&lt;/artifactId&gt;
              &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- ...other deps --&gt;
  
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>