title: Build War with multi module project
body: <p>I have a multi module maven project with three different modules Module-Data, Module-Domain, Module-Web. All three projects are spring boot projects, however Module-Web is the web component of the project that handles everything web oriented which I want to build a war file for. I have a parent project with the following pom file which contains no code.</p>
  
  <pre><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;com.somename&lt;/groupId&gt;
  &lt;artifactId&gt;My-Project&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  &lt;modules&gt;
      &lt;module&gt;module-data&lt;/module&gt;
      &lt;module&gt;module-domain&lt;/module&gt;
      &lt;module&gt;modele-web&lt;/module&gt;
  &lt;/modules&gt;
  </code></pre>
  
  <p></p>
  
  <p>Module-Domain depends on Module-Data and Module-Web depends on both Module-Data and Module-Domain. The problem I'm having is that when I try to build the project using maven it fails when building the Module-Domain with the following erros:</p>
  
  <pre><code>package com.somename.data.model does not exist // class file with this error
  </code></pre>
  
  <p>Module-Domain class files that imports from the Module-Data project fails with this error. I suspect this is because maven is not adding the Module-Data jar to the Module-Domain when building although its referenced in its pom file. How can I solve this problem and generate a war file with all dependencies?</p>
  
  <p>Module-Domain pom.xml:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.somename.data&lt;/groupId&gt;
          &lt;artifactId&gt;module-data&lt;/artifactId&gt;
          &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Module-Web pom.xml</p>
  
  <pre><code>   &lt;dependency&gt;
          &lt;groupId&gt;com.somename.data&lt;/groupId&gt;
          &lt;artifactId&gt;module-data&lt;/artifactId&gt;
          &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.somename.domain&lt;/groupId&gt;
          &lt;artifactId&gt;module-domain&lt;/artifactId&gt;
          &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>