Maven Snapshot Repository vs Release Repository

94,719

Solution 1

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 2

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 3

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

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

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

Share:
94,719
Joseph
Author by

Joseph

Updated on July 08, 2022

Comments

  • Joseph
    Joseph almost 2 years

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

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

  • Alexander Suraphel
    Alexander Suraphel about 8 years
    Sayat, Is 1.1.0.M5 or 1.1.0.M4 one version of the snapshot?
  • dna
    dna over 7 years
    This defines what release and snapshot artifacts are. But: are two distinct repositories needed?
  • Yoav Epstein
    Yoav Epstein about 7 years
    Found well written information at docs.oracle.com/middleware/1212/core/MAVEN/…
  • mks-d
    mks-d almost 7 years
    This does not answer the question, the question is about the distinction between release and snapshot repositories (not artifacts).
  • datv
    datv almost 7 years
    Thanks for the "When deployed, the SNAPSHOT is turned into a timestamp".
  • datv
    datv almost 7 years
    For "its under development, it can change anytime" (for -SNAPSHOT)
  • datv
    datv almost 7 years
    @mks-d Good observation but it's hard to understand a repository of something without understanding first what that "something" is. :) stackoverflow.com/a/5901460
  • frp farhan
    frp farhan about 6 years
    when i configured the job on jenkins and use upload artifacts to nexus snapshot repo, i could not see more than one snapshot. Generally when we make changes in the project & trigger a build a new artifact would be created. Although this is happening but it is renaming it to the same 1.0-SNAPSHOT rather it should name it as 2.0-SNAPSHOT & so on.. Any help.. @Brian Fox
  • frp farhan
    frp farhan about 6 years
    i had used in post build section of jenkins, deploy artifacts to maven repository and configured it as snapshot repo of nexus.