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:
repository
repository
And one dependency:
My questions:
I assume that the groupId of a dependency must be found as a subpath of one of the repo URLs, for example, http://repo-one.com/repos/org/mystuff. Is that right?
If so, then the artifactId is sought as an additional subpath, for example, http://repo-one.com/repos/org/mystuff/mystuff-core. Is that right?
If yes to both of the above, what if there is both an http://repo-one.com/repos/org/mystuff/mystuff-core, and an http://repo-two.com/repos/org/mystuff/mystuff-core? Does the first repository listed win?
If I'm completely off the track, what is the process for finding the dependencies on the respositories?
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.
Q1. and Q2. You are right.
More precisely, by default (i.e. if the repository layout wasn't redefined to a non standard layout) : the artifact will found at <REPO_URL>/${groupId_with_dot_replaced_by_subdir}/${artifactId}/${version}/${artifactId}-${version}.${extension}
Q3. Yes, the first repository containing the artifact wins. Note that
Q4. Here is a link to blog post explaining the maven repository layout