title: maven web module dependency
body: <p>I have parent web module called "PARENT". And I have another web module called "CHILD".
  PARENT module's packaging is war. How can I add a dependency in CHILD module.
  I have tried the following. But it doesn't works.</p>
  
  <p>Root pom.xml</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"&gt;
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
   &lt;groupId&gt;MY_App&lt;/groupId&gt;
   &lt;artifactId&gt;MY_App&lt;/artifactId&gt;
   &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
   &lt;packaging&gt;pom&lt;/packaging&gt;
   &lt;name&gt;MY Application&lt;/name&gt;
   &lt;url&gt;http://maven.apache.org&lt;/url&gt;
   &lt;repositories&gt;
    &lt;repository&gt;
     &lt;id&gt;ibiblio&lt;/id&gt;
     &lt;name&gt;iBiblio Maven2 Repository&lt;/name&gt;
     &lt;url&gt;http://www.ibiblio.org/maven2&lt;/url&gt;
    &lt;/repository&gt;
    &lt;repository&gt;
     &lt;id&gt;apache-repo&lt;/id&gt;
     &lt;name&gt;Apache Repository&lt;/name&gt;
     &lt;url&gt;http://people.apache.org/repo/m2-snapshot-repository&lt;/url&gt;
    &lt;/repository&gt;
   &lt;/repositories&gt;
   &lt;modules&gt;
    &lt;module&gt;MY_PARENT&lt;/module&gt;
    &lt;module&gt;MY_CHILD&lt;/module&gt;
   &lt;/modules&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>PARENT web module pom.xml</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 "&gt;
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
   &lt;parent&gt;
    &lt;artifactId&gt;MY_App&lt;/artifactId&gt;
    &lt;groupId&gt;MY_App&lt;/groupId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
   &lt;/parent&gt;
   &lt;groupId&gt;MY_App&lt;/groupId&gt;
   &lt;artifactId&gt;MY_PARENT&lt;/artifactId&gt;
   &lt;packaging&gt;war&lt;/packaging&gt;
   &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
   &lt;name&gt;MY_PARENT Webapp&lt;/name&gt;
   &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>CHILD web module pom.xml</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 "&gt;
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
   &lt;parent&gt;
    &lt;artifactId&gt;MY_App&lt;/artifactId&gt;
    &lt;groupId&gt;MY_App&lt;/groupId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
   &lt;/parent&gt;
   &lt;groupId&gt;MY_App&lt;/groupId&gt;
   &lt;artifactId&gt;MY_CHILD&lt;/artifactId&gt;
   &lt;packaging&gt;war&lt;/packaging&gt;
   &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
   &lt;name&gt;MY_CHILD Webapp&lt;/name&gt;
   &lt;url&gt;http://maven.apache.org&lt;/url&gt;
   &lt;dependencies&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;MY_App&lt;/groupId&gt;
     &lt;artifactId&gt;MY_PARENT&lt;/artifactId&gt;
     &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
     &lt;type&gt;war&lt;/type&gt;
    &lt;/dependency&gt;
   &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>While packaging the application I am getting compilation error. ie, CHILD module doesn't refers the classes of PARENT module.</p>
  
  <p><strong>Note:</strong> I have removed "<a href="http://maven.apache.org/maven-v4_0_0.xsd" rel="nofollow noreferrer">http://maven.apache.org/maven-v4_0_0.xsd</a>" this schema location because of the limitation.</p>