Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the name SNAPSHOT in jar mean? / What's wrong with *snapshot*.jars?

I am using bitlyj snapshot jar to shorten URLs from the following link.

http://code.google.com/p/bitlyj/downloads/list

Will somebody explain me the term snapshot.jar? Are snapshot.jar files unstable or is there anything wrong with these kind of jars? What does 'snapshot' generally mean?

like image 708
d-man Avatar asked Aug 04 '10 05:08

d-man


People also ask

What does snapshot mean for Jar?

It tells you when you should use snapshots. We generally tend to use snapshots for maven plugins (some features are available in latest snapshots). Copy link CC BY-SA 2.5.

What is snapshot in Java?

Java VisualVM enables you to take snapshots of application data and save the snapshots to your local system. Snapshots are a convenient way to capture data about an application because after a snapshot is saved it can be opened and viewed at any time.

What is the difference between snapshot and version?

The difference between a "real" version and a snapshot version is that snapshots might get updates. That means that downloading 1.0-SNAPSHOT today might give a different file than downloading it yesterday or tomorrow.

What is snapshot in version control?

As a general source control (version control) term, a snapshot version indicates a view of the source code taken at a specific time. This is not necessarily stable or ready for full use and can be changed in the future, as opposed to a release version which is stable and should be final.


3 Answers

SNAPSHOT indicates latest code in trunk or head. On whether you should use snapshot, the answer is depends:

  • Is there a fix for a bug in the snapshot release thats not available in the stable release?
  • Is there a new feature available in snapshot, but not available in stable version

You could make a call in these cases whether to use them or not.

Here's an article for your reference. It tells you when you should use snapshots.

We generally tend to use snapshots for maven plugins (some features are available in latest snapshots).

like image 51
naikus Avatar answered Oct 19 '22 08:10

naikus


Yes, those files are usually automatically created from the current development branch without any manual testing.

like image 40
Hendrik Brummermann Avatar answered Oct 19 '22 09:10

Hendrik Brummermann


To begin with it's versions vs snapshots. Maven downloads a particular artifact and its final. Maven never re-attempts to download a version already existing in the repository. If something has changed, then a new version is released and is not accommodated in the same/older version of the artifact.(changes => new versions)

Now let's say, you got a dependency, that is a work in progress/ changes are expected. If you are to use versions, every time the artifact is updated, you gotta change versions in your pom. So to avoid these, snapshots are used. Maven treats snapshots differently. It tries to pull the latest snapshot of the artifact. (default interval is the first build of the day, can be altered). So you don't have to keep changing versions anymore and just include a snapshot, it's pulled automatically.

Hope that helps, Happy coding!

Very beautifully explained in this article.

like image 32
Deekshith Anand Avatar answered Oct 19 '22 08:10

Deekshith Anand