0

In our project, we have multiple branches for our main features. As we develop, we want our repository to contain snapshots of the APIs in each branch, so that if a branch depends on another, it can easily get its APIs from the repository. However, we want it to hold multiple snapshot versions, so that if one snapshot breaks something, they can refer to an older snapshot. Our potential naming scheme goes like this

example-1.0-SNAPSHOT-01.jar

example-1.0-SNAPSHOT-02.jar

etc...

Most POM files will use LATEST for the version reference of these snapshot jars.

Anyways, my question is, how exactly does maven determine the LATEST version? Does it go off just the version number (which I think would just be 1.0 for both SNAPSHOT-01 and SNAPSHOT-02) or does it also incorporate a time-stamp?

Community
  • 1
  • 1
jvhashe
  • 1,071
  • 2
  • 12
  • 15

1 Answers1

2

repository management system (for example nexus) manages snapshots the latest is named as -SNAPSHOT.jar generally and rest of them have timestamp in the file name

jmj
  • 237,923
  • 42
  • 401
  • 438
  • This makes sense (I'm a recent college grad, so this is all new to me) and we do use Nexus. What would a developer use for the version if he/she didn't want to use the latest? Would `1.0-20130904452` be correct? – jvhashe Sep 04 '13 at 23:52
  • if that version exists then yes – jmj Sep 04 '13 at 23:54
  • I wouldn't use a specific time-stamped version. Most Nexus repos "age-out" their snapshots by keeping only the last N-many. Depending on how often your artifact is built that particular timestamp version might not last very long on the repo. – tdrury Sep 05 '13 at 02:04
  • @tdury Good point, but a developer would only use a time-stamped version if the newest snapshot broke something. That way they can continue on their feature without getting blocked. Thanks for the heads-up though. – jvhashe Sep 05 '13 at 16:27