Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven Snapshot Repository vs Release Repository

People also ask

What is the difference between snapshot and release in Maven?

A "release" is the final build for a version which does not change. A "snapshot" is a build which can be replaced by another build which has the same name. It implies that the build could change at any time and is still under active development.

What is snapshot repository in Maven?

A Maven snapshot is a special version of a Maven package that refers to the latest production branch code. It is a development version that precedes the final release version. You can identify a snapshot version of a Maven package by the suffix SNAPSHOT that is appended to the package version.

Why is it best practice not to release snapshot Maven artifacts to production?

It's strictly unrecommended to use SNAPSHOT version in your project dependencies since it's never guaranteed that a SNAPSHOT version is available in any repository. This can lead to well-know build errors due to missing dependencies .

What is snapshot repo?

A snapshot repository is an off-cluster storage location for your snapshots. You must register a repository before you can take or restore snapshots.


Release repositories hold releases and Snapshot repositories hold snapshots. In maven a snapshot is defined as an artifact with a version ending in -SNAPSHOT. When deployed, the snapshot is turned into a timestamp. By definition, snapshots are mutable, releases are immutable. This is why Nexus makes you store them separately because usually you don't care if you lose snapshots, but you will care if you lose releases. It makes snapshot cleanup much easier to deal with that way.


Release Artifacts

These are specific, point-in-time releases. Released artifacts are considered to be solid, stable, and perpetual in order to guarantee that builds which depend upon them are repeatable over time. Released JAR artifacts are associated with PGP signatures and checksums verify both the authenticity and integrity of the binary software artifact. The Central Maven repository stores release artifacts.

Snapshot Artifacts

Snapshots capture a work in progress and are used during development. A Snapshot artifact has both a version number such as “1.3.0” or “1.3” and a timestamp. For example, a snapshot artifact for commons-lang 1.3.0 might have the name commons-lang-1.3.0-20090314.182342-1.jar.

Taken from refcard


Usually in maven we have two types of builds:

1) Snapshot builds: SNAPSHOT is the special version that indicates current deployment copy and not a regular, specific version. Maven checks the version for every build in the remote repository. The snapshot builds are nothing but development builds.

2) Release builds: Release means removing the SNAPSHOT at the version ID for the build. These are the regular build versions.

Snapshot artifacts and release artifacts are push to snapshot, release repositories respectively.


Snapshots are maven idea to give version number as -SNAPSHOTS , its under development, it can change any time.

Internal repository is the release repository with fixed version number. You can modify the SNAPSHOTS, but That artifact never changes after it is released.