如何阻止Maven / Artifactory保留带有时间戳的快照 [英] How to stop Maven/Artifactory from keeping Snapshots with timestamps
问题描述
由于磁盘空间的考虑,我只希望在我的存储库中保留一个版本的任何快照。而不是保留带有时间戳后缀的多个版本
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
例如。电子商务-2.3-20090806.145007-1.ear
如何设置?这是一个构建设置或存储库(Artifactory)设置
How can I set this up? Is this a build setting or repository (Artifactory) setting
谢谢!
推荐答案
最简单的(以及推荐)方式是使用非唯一快照。如果必须使用唯一快照,则可以通过指定< maxUniqueSnapshots>在Artifactory中执行此操作。 < localRepository>上的属性artifactory.config.xml中的定义
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
例如:
<localRepository>
<key>snapshots</key>
<blackedOut>false</blackedOut>
<handleReleases>false</handleReleases>
<handleSnapshots>true</handleSnapshots>
<maxUniqueSnapshots>1</maxUniqueSnapshots>
<includesPattern>**/*</includesPattern>
<snapshotVersionBehavior>non-unique</snapshotVersionBehavior>
</localRepository>
作为参考,您可以在 Nexus (通过用户界面)设置预定服务,它允许您指定要保留的最小数量,保留它们的最长时间以及是否在发布版本为时删除快照部署。
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.
这篇关于如何阻止Maven / Artifactory保留带有时间戳的快照的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!