Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do a lot of Maven dependency versions end with SNAPSHOT?

Is there any special meaning for snapshot in the Maven version?

like image 722
user496949 Avatar asked Feb 25 '23 23:02

user496949


2 Answers

Yes

SNAPSHOT - means it's not the final version. The code is still being developed and the artifact is not released. It may have bugs.

From: http://maven.apache.org/guides/getting-started/index.html

version This element indicates the version of the artifact generated by the project. Maven goes a long way to help you with version management and you will often see the SNAPSHOT designator in a version, which indicates that a project is in a state of development. We will discuss the use of snapshots and how they work further on in this guide.

This has even long article: http://sonatype.com/books/maven-book/reference/pom-relationships-sect-pom-syntax.html see under 3.3.1.2. SNAPSHOT Versions headline

Why would you use this? SNAPSHOT versions are used for projects under active development. If your project depends on a software component that is under active development, you can depend on a SNAPSHOT release, and Maven will periodically attempt to download the latest snapshot from a repository when you run a build. Similarly, if the next release of your system is going to have a version "1.4", your project would have a version "1.4-SNAPSHOT" until it was formally released.

like image 66
Nishant Avatar answered Mar 16 '23 19:03

Nishant


Any project version with SNAPSHOT in it means that its a development build, not a release, and is usually built off of whatever's the newest commit in the repository.

This means they are not stable since someone could commit broken code, broken project gets built, and sometime later you update to the newest build which is broken.

like image 30
TheLQ Avatar answered Mar 16 '23 18:03

TheLQ