Maven - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Maven Snapshot

Maven Snapshot

shape Introduction

When working on large projects, many changes will be reflected in projects as many teams will be working simultaneously on different modules. Maven Snapshot chapter explains about the Snapshot and Snapshot vs Version.

shape Description

Suppose, there are two teams. One working on JavaSamples project, which is dependent on the services of other Splessons project. Let Splessons project members work on critical fixes that will be reviewed everyday. So, JavaSamples project has to wait until the work is done by the Splessons project. Here, Snapshot is used. Maven Snapshot is defined as the revised copy of the development work being done. Snapshot of the project will be taken for every build by replacing the .jar files with the new one in the local repositories. Once the application is released, snapshot will not work as it will be updated only during the development phase of a project.

Snapshot Vs Version:

Maven Snapshot will take the newer snapshot automatically when the project is build. Whereas, Version will not take the responsibility till the download of version is completed.

shape Examples

To download the updated code, Splessons version has to be upgraded to 1.1. [xml] <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>Splessons</groupId> <artifactId>Splessons</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <url>http://maven.apache.org</url> </project> [/xml]

Summary

shape Key Points

  • Maven Snapshot updates the builds of every project.
  • Unlike version archetype, the process of snapshot is automatic.