Due to disk space considerations I'd like to only ever keep one version of any snapshot in my repository. Rather than keeping multiple versions with timestamp suffixes
e.g. ecommerce-2.3-20090806.145007-1.ear
How can I set this up? Is this a build setting or repository (Artifactory) setting
Thanks!
Once you have created your Maven repository, go to Application | Artifactory | Artifacts, select your Maven repository and click Set Me Up. In the Set Me Up dialog, click Generate Maven Settings. You can now specify the repositories you want to configure for Maven.
A Maven snapshot is a special version of a Maven package that refers to the latest production branch code. It is a development version that precedes the final release version. You can identify a snapshot version of a Maven package by the suffix SNAPSHOT that is appended to the package version.
Maven Snapshot Version Behavior Artifactory supports centralized control of how snapshots are deployed into a repository, regardless of end user-specific settings. This can be used to guarantee a standardized format for deployed snapshots within your organization.
Snapshots are defined as artifacts that whose version ends in “-SNAPSHOT” in other word… 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.
The simplest (and recommended) way is to use non-unique snapshots. If you must use unique snapshots, you can do this in Artifactory by specifying the <maxUniqueSnapshots> property on the <localRepository> definition in artifactory.config.xml
For example:
<localRepository> <key>snapshots</key> <blackedOut>false</blackedOut> <handleReleases>false</handleReleases> <handleSnapshots>true</handleSnapshots> <maxUniqueSnapshots>1</maxUniqueSnapshots> <includesPattern>**/*</includesPattern> <snapshotVersionBehavior>non-unique</snapshotVersionBehavior> </localRepository>
For reference you can do this in Nexus (via the UI) by setting up a scheduled service, it allows you to specify the minimum number to retain, the maximum period to retain them for, and whether to remove the snapshot if a release version is deployed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With