title: Why Maven doesn't install dependencies in multimodule project?
body: <p>My project structure (multi module) is like this</p>
  
  <pre><code>parent
      projectA
      projectB
      ... other modules
  </code></pre>
  
  <p><code>parent</code> also actually has a parent (Spring Boot). </p>
  
  <p>I have set up a Jenkins jobs to compile &amp; test on every commit, so it runs:</p>
  
  <pre><code>mvn -f pom.xml clean install
  </code></pre>
  
  <p>And that all works fine. <code>ProjectB</code> depends on <code>ProjectA</code> (which is like a common classes type of project) and is a Spring boot application. So the dependency information is the regular:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;Group&lt;/groupId&gt;
          &lt;artifactId&gt;ProjectA&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><code>ProjectB</code> has a separate job in Jenkins to build the deployable jar file and deploy it to server. So the command there is:</p>
  
  <pre><code>mvn -f ProjectB/pom.xml clean install antrun:run
  </code></pre>
  
  <p>This fails with a message like:</p>
  
  <pre><code>[WARNING] The POM for Group:ProjectB:1.0-SNAPSHOT is missing, no dependency information available
  ...
  [ERROR] Failed to execute goal on project host-api: Could not resolve dependencies for project Group:ProjectB:1.0-SNAPSHOT: The following artifacts could not be resolved: Group:ProjectA:jar:1.0-SNAPSHOT...
  </code></pre>
  
  <p>Now I can resolve this by doing a <code>mvn install</code> in the <code>ProjectA</code> directory - I've tested this and it does resolve the issue.</p>
  
  <p>But my question is <strong>why should I have to</strong>? Shouldn't Maven figure out it should be installing the jar in the local repo?</p>
  
  <p>Thanks in advance</p>