Maven Snapshot Repository vs Release Repository

MavenRepositoryReleaseNexusSnapshot

Maven Problem Overview


What is the difference between a Snapshot Repository and Release Repository?

This is with reference to setting up Repositories (like Artifactory, Nexus etc)

Maven Solutions


Solution 1 - Maven

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.

Solution 2 - Maven

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

Solution 3 - Maven

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.

Solution 4 - Maven

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.

Solution 5 - Maven

SNAPSHOT here doesn't really mean ONE snapshot which is frozen and won't change, SNAPSHOT covers several snapshots whose modifications are not big enough for being represented by a new version number

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJosephView Question on Stackoverflow
Solution 1 - MavenBrian FoxView Answer on Stackoverflow
Solution 2 - MavenSayat SatybaldView Answer on Stackoverflow
Solution 3 - MavenVenky VungaralaView Answer on Stackoverflow
Solution 4 - MavenAKTView Answer on Stackoverflow
Solution 5 - MavenYourBestBetView Answer on Stackoverflow