heater
heater

Reputation: 195

Maven snapshot "lifecycle"

Here is my current understand of how Maven handles dependencies.

When a dependency is being actively worked on Maven attaches the "-SNAPSHOT" to the end of the version. ex) 1.1.1-SNAPSHOT. These snapshots are uploaded to a remote repository that is specifically responsible for snapshots. The same remote repository has a section for released versions of the packages. Now when a project has the dependencies updated, Maven pulls the most recent version of a package into the local repository. ONLY SNAPSHOTS are updated depending on the time stamp on the the snapshot. If Maven pulls down a release version (ex: 1.1.0) it will never look for another package with the current version.

Now my questions are:

Upvotes: 2

Views: 588

Answers (1)

Eugen Martynov
Eugen Martynov

Reputation: 20130

Snapshots are currently in development versions and could be not stable.

We are old fashioned company which still use svn:

  1. The development is going in the trunk and version in pom files are snapshots (we have dependencies to some opensource libraries that have fixed version, and we update them as soon as new release happens and we are confident about switching)
  2. As soon as we are going to release we are branching trunk and changing versions in pom to corresponded fixed one (some companies could mark them with suffix -rc)
  3. Release (Companies that use -rc will change version in pom to fixed one)

Please take a look to release maven plugin to skip manual version changes.

I hope this answers some of your questions.

About the versioning answer - it depends. Please read about it more here:

http://en.wikipedia.org/wiki/Software_versioning

Best Practice: Software Versioning

Upvotes: 1

Related Questions