Simple Maven clarification; I hope this will be easy to answer from an experienced Maven developer.
I have two projects called mycompany-x and mycompany-y. mycompany-x is listed as a dependency of mycompany-y, and each has version 1.0-SNAPHSOT. Our Maven build is deployed to an internal Maven repository by a continuous build server. Snapshots of each are shared between developers via this server. We are using Maven 3.
At any given time, when I run the install goal of mycompany-y, there may be two jars in the repository for mycompany-x: one, labeled 1.0-SNAPSHOT, that is the result of a local build; the second, labeled 1.0-, downloaded as a resolution to the 1.0-SNAPHSOT from our Maven repository. This creates an obvious ambiguity when mycompany-y attempts to resolve 1.0-SNAPSHOT of mycompany-x; one which I am quite certain the Maven community has an explicit policy to resolve (although it is not clear in the docs).
In the following scenarios, which jar (local or remote) is included in the classpath of the build?
- Run mvn install on mycompany-x and mycompany-y.
- Run mvn install on mycompany-y, without having previously run install on mycompany-x.
- Run mvn install on mycompany-y, having recently built mycompany-x (and no later version in the remote repository).
- Run mvn install on mycompany-y, having recently built mycompany-x (but with a more recent version in the remote repository).
Note: Maven: How to ensure timestamped versions of snapshots are used in classpath? references a published algorithm, which I can't seem to find anywhere. I would accept a link there as a fine answer.