title: Maven dependency mapping to repositories
body: <p>I'm new to Maven, although I'm experienced with Ant.  I'm trying to understand the process of downloading dependencies.  Let's say I've defined two repositories:</p>
  
  <ul>
  <li><p>repository</p>
  
  <ul>
  <li>id:repo-one</li>
  <li>url:<a href="http://repo-one.com/repos" rel="nofollow">http://repo-one.com/repos</a></li>
  </ul></li>
  <li><p>repository</p>
  
  <ul>
  <li>id:repo-two</li>
  <li>url:<a href="http://repo-two.com/repos" rel="nofollow">http://repo-two.com/repos</a></li>
  </ul></li>
  </ul>
  
  <p>And one dependency:</p>
  
  <ul>
  <li>dependency
  <ul>
  <li>groupId:org.mystuff</li>
  <li>artifactId:mystuff-core</li>
  </ul></li>
  </ul>
  
  <p>My questions:</p>
  
  <ol>
  <li><p>I assume that the groupId of a dependency must be found as a subpath of one of the repo URLs, for example, <a href="http://repo-one.com/repos/org/mystuff" rel="nofollow">http://repo-one.com/repos/org/mystuff</a>.  Is that right?</p></li>
  <li><p>If so, then the artifactId is sought as an additional subpath, for example, <a href="http://repo-one.com/repos/org/mystuff/mystuff-core" rel="nofollow">http://repo-one.com/repos/org/mystuff/mystuff-core</a>.  Is that right?</p></li>
  <li><p>If yes to both of the above, what if there is both an <a href="http://repo-one.com/repos/org/mystuff/mystuff-core" rel="nofollow">http://repo-one.com/repos/org/mystuff/mystuff-core</a>, and an <a href="http://repo-two.com/repos/org/mystuff/mystuff-core" rel="nofollow">http://repo-two.com/repos/org/mystuff/mystuff-core</a>?  Does the first repository listed win?</p></li>
  <li><p>If I'm completely off the track, what is the process for finding the dependencies on the respositories?</p></li>
  </ol>
  
  <p>As you can probably tell, I'm looking at an existing POM and trying to understand just how it works.  I've reviewed the documentation on the Maven site, but so far I don't see anything that explicitly states how dependencies are mapped to repositories.</p>