Table of Contents

Maven - Snapshot (Version|Dependency)

About

A snapshot is a artifact that has not been released.

The difference between a release version and a snapshot version is that snapshots might get updates.

The snapshot property of a artifact is defined in its version. See syntax.

The -SNAPSHOT version is replaced by a the deployment/upload date/timestamp and an enumerator

Syntax

A snapshot version in Maven is one that has not been released. -SNAPSHOT is a reserved string used to identify versions that are currently in development.

A snapshot version is:

<version>
description-SNAPSHOT
</version>

where:

With this pattern, Maven will know that this version is not stable and is subject to changes.

Management

Force Update

mvn clean install -U

where:

Configuration

When you build an application, Maven will search Snapshot version dependencies once a day

Maven provides you a way to can change this update policy in the settings.xml repository definition:

<repository>
    <id>foo-repository</id>
    <url>...</url>
    <snapshots>
        <enabled>true</enabled>
        <updatePolicy>XXX</updatePolicy>
    </snapshots>
</repository>

where XXX can be:

Support

Failure to find snapshot artifact, resolution will not be reattempted until

Failure to find artifact in repo was cached in the local repository, resolution will not be reattempted until the update interval of repo has elapsed or updates are forced

Resolution:

Documentation / Reference