如何阻止 Maven/Artifactory 保留带有时间戳的快照 [英] How to stop Maven/Artifactory from keeping Snapshots with timestamps

查看:56
本文介绍了如何阻止 Maven/Artifactory 保留带有时间戳的快照的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于磁盘空间方面的考虑,我想在我的存储库中只保留任何快照的一个版本.而不是保留带有时间戳后缀的多个版本

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

例如ecommerce-2.3-20090806.145007-1.ear

我该如何设置?这是构建设置还是存储库(Artifactory)设置

How can I set this up? Is this a build setting or repository (Artifactory) setting

谢谢!

推荐答案

最简单的(和 推荐) 方法是使用非唯一快照.如果您必须使用唯一的快照,您可以通过指定 <maxUniqueSnapshots> 在 Artifactory 中执行此操作. 上的属性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(通过 UI)中通过设置 预定服务,它允许您指定要保留的最小数量、保留它们的最长时间以及是否在部署发布版本时删除快照.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆