如何限制Nexus中部署的快照工件的数量? [英] How to limit number of deployed snapshots artifacts in Nexus?

查看:619
本文介绍了如何限制Nexus中部署的快照工件的数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Nexus来部署我们的快照工件。我们的构建服务器使用以下命令在每次构建期间部署它们:mvn deploy。
作为每次构建的结果,将部署更新版本的工件。已经将大量工件部署到存储库的问题当然我们只需要最后一个工件。
是否有办法限制Nexus中已部署快照的工件数量?
感谢您的帮助,
Michael

We are using Nexus to deploy our snapshot artifacts. Our build server deploys them during each build using the following command: mvn deploy. As result on each build the newer version of the artifact is deployed. The problem that already about dozens of artifacts are deployed to the repository and of course we need only the last artifact. Is any way to limit number of deployed snapshots artifacts in Nexus? Thanks for your help, Michael

推荐答案

创建计划任务以清除旧快照。

Create a scheduled task to purge out old snapshots.

以下链接描述了这个功能:

The following links describe the functionality:

  • Nexus scheduled tasks
  • Managing scheduled tasks - Repository Manager 2
  • Configuring and Executing Tasks - Repository Manager 3

您可以将任务配置为始终保持最少数量的工件。它非常灵活。

You can configure the task to always keep a minimum number of artifacts. It's very flexible.

Repository Manager第2版中唯一的问题是,你还需要运行第二个任务,清空垃圾箱,以声明回磁盘空间。对于版本3,您需要运行 Compact blob store 以确保删除将返回磁盘空间。请参阅上面的文档。

The only "gotcha" in Version 2 of the Repository Manager, is that you'll need to also run a second task, Empty Trash, in order to claim back the disk space. For Version 3 you will need to run Compact blob store to ensure that the deletion will return the disk space. See docs above.

这篇关于如何限制Nexus中部署的快照工件的数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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