Say I have a project A
in development that depends on project B
- which is also currently in development and not yet released.
So, in A
's POM file, I have the following section:
<dependency>
<groupId>com.example</groupId>
<artifactId>project-b</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
At work, we have a remote repo (Nexus) and a CI box (running Jenkins).
When my colleague makes a change to B
and commits to SVN, Jenkins will pick that change up, compile it and put it into the remote repo. Around that time, I might open B
locally, make a change, compile it and install it into my local repo.
How does Maven now resolve B
when I try to mvn clean install
A
locally?
- Will it always default to my local SNAPSHOT if it finds one?
- Will it always default to the remote SNAPSHOT?
- Will it look at time stamps?
- Will it do something different?
We got ourselves a bit into a mess the other day, and basically had to manually remove the local repositories to ensure we got the version we were expecting to get. So I'm now trying to figure out what really went on. (Therefore, if you have links to places in the docs that go into detail, that, too, would be much appreciated...) Locally, I sometimes have a few SNAPSHOT builds in my repository folder, one without and a few with what looks like a timestamp after the SNAPSHOT
part of the file name...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…