title: Multi-module Maven POM
body: <p>I have a parent project with 2 maven modules a simple Java Application (generated with maven-archetype-quickstart) and a GWT Application (generated with gwt-maven-plugin).</p>
  
  <p>I am trying to set both modules' output directories to the parent /target/ folder, but while the application compiles with no errors, when i try to run it in tomcat [with <code>mvn tomcat:run</code>] I get the following error :</p>
  
  <pre><code>[ERROR] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Compilation failure
  Failure executing javac, but could not parse the error:
  javac: directory not found: /null/null/WEB-INF/lib
  Usage: javac &lt;options&gt; &lt;source files&gt;
  use -help for a list of possible options
  </code></pre>
  
  <p>The three pom.xml files are as follows : </p>
  
  <h2>Parent POM</h2>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;gr.veltisto&lt;/groupId&gt;
      &lt;artifactId&gt;ennovation&lt;/artifactId&gt;
      &lt;version&gt;0.1.1&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;      
  
      &lt;modules&gt;
          &lt;module&gt;core&lt;/module&gt;
          &lt;module&gt;gwt&lt;/module&gt;
      &lt;/modules&gt;
  &lt;/project&gt;
  </code></pre>
  
  <h2>java module POM</h2>
  
  <pre class="lang-xml prettyprint-override"><code>&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;gr.veltisto.ennovation&lt;/groupId&gt;
  &lt;artifactId&gt;core&lt;/artifactId&gt;
  &lt;version&gt;0.1.1&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;name&gt;Veltisto Core Maven Module&lt;/name&gt; 
  
  &lt;parent&gt;
      &lt;groupId&gt;gr.veltisto&lt;/groupId&gt;
      &lt;artifactId&gt;ennovation&lt;/artifactId&gt;
      &lt;version&gt;0.1.1&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      (...)
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;outputDirectory&gt;/${project.parent.build.directory}/${project.parent.build.finalName}/WEB-INF/lib&lt;/outputDirectory&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.5.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;compilerVersion&gt;1.6&lt;/compilerVersion&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <h2>GWT module POM</h2>
  
  <pre class="lang-xml prettyprint-override"><code>&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;!-- POM file generated with GWT webAppCreator --&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;gr.veltisto.ennovation&lt;/groupId&gt;
  &lt;artifactId&gt;gwt&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;0.0.1&lt;/version&gt;
  &lt;name&gt;Veltisto GWT Maven Module&lt;/name&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;gr.veltisto&lt;/groupId&gt;
      &lt;artifactId&gt;ennovation&lt;/artifactId&gt;
      &lt;version&gt;0.1.1&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;properties&gt;
      &lt;!-- Convenience property to set the GWT version --&gt;
      &lt;gwtVersion&gt;2.5.0-rc1&lt;/gwtVersion&gt;
      &lt;!-- GWT needs at least java 1.5 --&gt;
      &lt;webappDirectory&gt;/${project.parent.build.directory}/${project.parent.build.finalName}&lt;/webappDirectory&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.gwt&lt;/groupId&gt;
          &lt;artifactId&gt;gwt-servlet&lt;/artifactId&gt;
          &lt;version&gt;${gwtVersion}&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.gwt&lt;/groupId&gt;
          &lt;artifactId&gt;gwt-user&lt;/artifactId&gt;
          &lt;version&gt;${gwtVersion}&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.7&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.validation&lt;/groupId&gt;
          &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
          &lt;version&gt;1.0.0.GA&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.validation&lt;/groupId&gt;
          &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
          &lt;version&gt;1.0.0.GA&lt;/version&gt;
          &lt;classifier&gt;sources&lt;/classifier&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.gwtbootstrap&lt;/groupId&gt;
          &lt;artifactId&gt;gwt-bootstrap&lt;/artifactId&gt;
          &lt;version&gt;2.0.4.0&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;!-- Generate compiled stuff in the folder used for developing mode --&gt;
      &lt;outputDirectory&gt;${webappDirectory}/WEB-INF/classes&lt;/outputDirectory&gt;
  
      &lt;plugins&gt;
  
          &lt;!-- GWT Maven Plugin --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;gwt-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.5.0-rc1&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;goal&gt;test&lt;/goal&gt;
                          &lt;goal&gt;i18n&lt;/goal&gt;
                          &lt;goal&gt;generateAsync&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;!-- Plugin configuration. There are many available options, see gwt-maven-plugin 
                  documentation at codehaus.org --&gt;
              &lt;configuration&gt;
                  &lt;runTarget&gt;gwt.html&lt;/runTarget&gt;
                  &lt;hostedWebapp&gt;${webappDirectory}&lt;/hostedWebapp&gt;
                  &lt;i18nMessagesBundle&gt;gr.veltisto.ennovation.client.Messages&lt;/i18nMessagesBundle&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;!-- Copy static web files before executing gwt:run --&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.1.1&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;compile&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;exploded&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;webappDirectory&gt;${webappDirectory}&lt;/webappDirectory&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.5&lt;/source&gt;
                  &lt;target&gt;1.5&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>PS. When i run <code>mvn compile</code> the output directories are properly created. Only when i run <code>mvn tomcat:run</code> i get the <code>/null/null/WEB-INF/lib</code> reference</p>