title: Maven Modules + Building a Single Specific Module
body: <p>I have a multi-module Maven project with a parent project <code>P</code> and three sub-modules <code>A</code>, <code>B</code>, and <code>C</code>.  Both <code>B</code> and <code>C</code> are war projects and both depend on <code>A</code>.  </p>
  
  <p>I can type <code>mvn compile</code> in <code>P</code> and have all of the sub-modules properly compiled. The problem comes when I want to do operations for specific modules.</p>
  
  <p>I'd like to be able to package a war for project <code>B</code>, but when I run the package command from <code>B</code>'s directory, it complains that it can't find the dependencies for <code>A</code>.  </p>
  
  <p>I understand from this question: <a href="https://stackoverflow.com/questions/808516/maven-and-dependent-modules">Maven and dependent modules</a> that perhaps Maven isn't really designed for this type of dependency resolution, but that begs the question of how do I package <code>B</code>?  </p>
  
  <ol>
  <li><p>Do I have to run <code>mvn package</code> for the entire project hierarchy when I really just want <code>B</code>?  </p></li>
  <li><p>Do I have to install snapshots of A into my local repository every time I want to package <code>B</code>?  </p></li>
  </ol>
  
  <p>This second scenario isn't much fun when <code>A</code> is still under active development.</p>
  
  <p>Any best practices here?</p>