title: How can I make one Maven module depend on another?
body: <p>OK, I <em>thought</em> I understood how to use Maven...</p>
  
  <p>I have a master project <code>M</code> which has sub-projects <code>A</code>, <code>B</code>, and <code>C</code>.  <code>C</code> contains some common functionality (interfaces mainly) which is needed by <code>A</code> and <code>B</code>.  I can run <code>mvn compile jar:jar</code> from the project root directory (the <code>M</code> directory) and get JAR files <code>A.jar</code>, <code>B.jar</code>, and <code>C.jar</code>.  (The versions for all these artifacts are currently <code>2.0-SNAPSHOT</code>.)</p>
  
  <p>The master <code>pom.xml</code> file in the <code>M</code> directory lists <code>C</code> under its <code>&lt;dependencyManagement&gt;</code> tag, so that <code>A</code> and <code>B</code> can reference <code>C</code> by just including a reference, like so:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;my.project&lt;/groupId&gt;
      &lt;artifactId&gt;C&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>So far, so good.  I can run <code>mvn compile</code> from the command line and everything works fine.  But when I open the project in NetBeans, it complains with the problem: "Some dependency artifacts are not in the local repository", and it says the missing artifact is <code>C</code>.  Likewise from the command line, if I change into the <code>A</code> or <code>B</code> directories and try to run <code>mvn compile</code> I get "Build Error: Failed to resolve artifact."</p>
  
  <p>I expect I could manually go to where my <code>C.jar</code> was built and run <code>mvn install:install-file</code>, but I'd rather find a solution that enables me to just work directly in NetBeans (and/or in Eclipse using m2eclipse).</p>
  
  <p>What am I doing wrong?</p>