title: maven - using local source instead of external dependency
body: <p>If someone could help me out here it would save me a lot of time.  </p>
  
  <p>I maintain an open source library that gets pushed out to a sonatype repository. I make changes to that library a few times a day and push it out to the 1.0_snapshot build using mvn deploy.
  Let's call it project1</p>
  
  <p>I work constantly in another project that uses that library let's call it project2. </p>
  
  <p>Right now, whenever i make changes to project 1 or 2, i need to first build and deploy project 1 to the repo, then build project 2 so it downloads a fresh copy of project1.jar</p>
  
  <p>Project2 has Project1 as a dependency in a pom.xml:</p>
  
  <pre><code> &lt;dependency&gt;
              &lt;groupId&gt;com.group&lt;/groupId&gt;
              &lt;artifactId&gt;project1&lt;/artifactId&gt;
              &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
   &lt;/dependency&gt;
  </code></pre>
  
  <p>in order to build in a way where all of my changes can be tested, I have to do something like this:</p>
  
  <pre><code>mvn  -f ./project1/pom.xml clean deploy  
  mvn  -U -f ./project2/pom.xml clean package  
  </code></pre>
  
  <p>this uploads my project1.jar to sonatype, then project2 downloads the new snapshot and builds it. </p>
  
  <p>This is a simplified picture of what i'm doing on a larger scale, where my compiles take 5 minutes of up and downloads.</p>
  
  <p>Question: What is the proper way to use maven so it knows to use the source of project1 in a dependency in project 2?</p>