title: Maven module dependency source instead of repository jars
body: <p>I have a multi-module project, i.e.</p>
  
  <pre><code>parent
    module1
    module2
  </code></pre>
  
  <p>In one dev cycle, I added a class <code>mod1.A</code> to module1. Class <code>mod2.B</code> in module2 depends on it.</p>
  
  <p>I do not have the artifacts in my local <code>.m2/repository</code>. Running this:</p>
  
  <pre><code>$ cd prj/module2
  $ mvn -o exec:java -Dexec.mainClass=mod2.B
  </code></pre>
  
  <p>results in an error along the lines of:</p>
  
  <pre><code>The following artifacts could not be resolved: com.example:module1:jar:1.0-SNAPSHOT
  </code></pre>
  
  <p>After I install the artifacts via <code>mvn install</code> while in the <code>prj</code> folder, it all works as expected. </p>
  
  <p>However, this presents an issue in at least two ways:</p>
  
  <ul>
  <li>I have to go through the slower install phase instead of the faster compile phase</li>
  <li>I have two versions of the same project and conflicting modifications in these. I cannot run the same Java class with their respective modifications, only the currently installed modifications, considering they are both the same SNAPSHOT version</li>
  </ul>
  
  <p>There are workaround for both (skip parts of the build for the first, different snapshot versions for the second), but they are far from usable in practice.</p>
  
  <p>Is there a way to make maven use the local modules, instead of using artifacts from local maven repository?</p>