Maven Snapshot Repository vs Release Repository
Last Updated :
23 Jul, 2025
Maven Repositories contain many sorts of build artifacts and dependencies. Two types of repositories are local and remote. A local repository is a directory on the computer that executes Maven. It stores remote downloads and builds artifacts.
In this article, we will discuss about Maven Snapshot Repository vs Release Repository.
Maven Snapshot Repository
Maven Snapshots are used to capture a work in progress while it is being developed. In Maven, a snapshot is an artifact whose version ends with -SNAPSHOT. When deployed, the snapshot is converted to a timestamp. Snapshots, by definition, can be changed, whereas releases cannot. This is why requires you to keep them separately and normally don't care if you lose snapshots, but you do if you lose releases. This makes snapshot cleanup much easier to manage. A Snapshot artifact includes both a version number and a timestamp.
Example of Maven Snapshot Repository:
XML
<project xmlns="https://maven.apache.org/POM/4.0.0"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.geeksforgeeks</groupId>
<artifactId>my-project</artifactId>
<version>1.0-SNAPSHOT</version>
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<name>Snapshot Repository</name>
<url>http://my.
geeksforgeeks.org/maven2/snapshots</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>central</id>
<name>Maven Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>company-snapshots</id>
<name>Company Snapshot Repository</name>
<url>http://my.geeksforgeeks.org/maven2/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
Maven Release Repository
Maven Release repositories hold releases, while Snapshot repositories store snapshots. Artifacts that have been generated and signed are immediately copied and saved to this separate repository, where they cannot be altered or deleted. Release Repository ensures that the distribution is consistent across target instances. Even if the original artifacts are removed from the original repository, they will remain in the release bundle repository, ready for distribution.
Example of Maven Release Repository:
XML
<project xmlns="https://maven.apache.org/POM/4.0.0"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.geeksforgeeks</groupId>
<artifactId>my-project</artifactId>
<version>1.0.0</version>
<distributionManagement>
<repository>
<id>releases</id>
<name>Release Repository</name>
<url>http://my.
geeksforgeeks.org/maven2/releases</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>central</id>
<name>Maven Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>company-releases</id>
<name>Company Release Repository</name>
<url>http://my.geeksforgeeks.org/maven2/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
Difference Between Maven Snapshot Repository and Release Repository
Below is the difference table of Maven Snapshot Repository and Release Repository.
Maven Snapshot Repository | Maven Release Repository |
---|
The Maven snapshot version is a version that has not been released yet. | The Maven release repository mostly contains the final versions of artifacts. |
Snapshot repository for projects still in development. | Release repositories are for projects that are ready for production. |
Maven Snapshot repositories store snapshots. | Maven Release repositories hold releases. |
Maven Snapshot, by definition, can be changed. | The Maven Release Repository can not be changed. |
Similar Reads
Maven Remote Repository Maven Remote Repository is one of the repositories in the Maven repositories. It is a repository on a remote server that contains artifacts, that can be used by Maven projects. These artifacts include libraries, plugins, and other dependencies that a project may require. The remote repository is acc
4 min read
Difference Between Registry and Repository During the software development process, the terms âregistryâ as well as ârepositoryâ are constantly used interchangeably in software. However, for efficient project management, it is important to understand that they are two different terms. In this article, we are going to distinguish between âreg
4 min read
Spring Boot - Difference Between CrudRepository and JpaRepository Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because of its rapid production-ready environment which enables the developers to directly focus on the logic instead of struggling with the configuration and se
3 min read
Maven Repositories The Maven Repository is a storage location where Maven stores and retrieves project dependencies, including JAR files, libraries and plugins. It helps manage and share code efficiently during the build process.Types of Maven RepositoriesLocal RepositoryCentral RepositoryRemote RepositoryLocal Reposi
2 min read
Maven - Snapshots A Maven Snapshot is a specific version of a Maven package that contains the most recent production branch code. It is a development version that comes before the final release version. A snapshot version of a Maven package is identified by the suffix SNAPSHOT applied to the package version number. S
3 min read
Maven Central Repository The Maven Central Repository is a widely used repository for Java developers to find open-source libraries and artifacts in Maven projects. It is the default repository in Apache Maven, a build automation tool primarily used for Java projects. Later, it was updated to support other types of projects
3 min read