简体   繁体   English

如何自动从OSS 3.0.0上托管的Maven存储库中删除工件的旧版本?

[英]How to automatically delete old versions of artifacts from hosted maven repository on OSS 3.0.0?

We are building and deploying multiple releases for various services in a single day. 我们将在一天内为各种服务构建和部署多个版本。 Due to this we are wasting a lot of storage for storing older versions of artifacts which will never be used again. 因此,我们浪费了大量的存储空间来存储较旧版本的构件,这些构件将不再使用。

Is there a way to automatically delete older versions and just keep few versions such as last 10 in OSS 3.0.0 ? 有没有一种方法可以自动删除较旧的版本,而仅保留少数版本,例如OSS 3.0.0中的最后10个?

I searched there documentation but couldn't find anything that works automatically. 我在那儿搜索了文档,但是找不到能自动运行的任何东西。 Currently I have to manually select and delete them which is very error prone and time consuming. 当前,我必须手动选择和删除它们,这非常容易出错并且很耗时。

Few details about my setup: 关于我的设置的一些细节:

  1. "File" type "blob" is used for storage. “文件”类型“ blob”用于存储。
  2. Repository is self "hosted" with format "maven2" 存储库是自我“托管”的,格式为“ maven2”

There are a few options you can use in Nexus Repository 3.x for Snapshots, from https://books.sonatype.com/nexus-book/reference3/admin.html#admin-system-tasks : 您可以在https://books.sonatype.com/nexus-book/reference3/admin.html#admin-system-tasks中的Nexus知识库3.x中为快照使用一些选项:

  • Purge unused Maven snapshot versions 清除未使用的Maven快照版本
  • Remove snapshots from Maven repository 从Maven存储库中删除快照

As for Releases, removing Releases can be an anti-pattern, you generally should keep your releases around if others rely on them, etc... 至于发布,删除发布可能是一种反模式,如果其他人依赖发布,则通常应该保留发布,等等。

There is a JIRA ticket for Removing Releases which you can follow at: https://issues.sonatype.org/browse/NEXUS-10821 您可以在以下位置找到JIRA的“删除发行版”票证: https : //issues.sonatype.org/browse/NEXUS-10821

This is also answered here: Purge old release from Nexus 3 在此也可以得到答复: 从Nexus 3清除旧版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 jenkins 中删除 Maven 本地存储库中的旧工件 - How to delete old artifacts in maven local repository in jenkins 将jar工件上传到nexus OSS 3.0.0-03中的托管Maven存储库时出现问题 - Problems uploading jar artifact to hosted maven repository in nexus OSS 3.0.0-03 Maven - 从所有旧工件版本中清除本地.m2 - Maven - purge local .m2 from all old artifacts versions 如何在Nexus存储库管理器中绑定Maven工件的版本? - How do you peg versions of Maven artifacts in the Nexus repository manager? Maven不会从存储库服务器中删除额外的工件 - Maven does not delete extra artifacts from repository server 从Maven本地存储库中删除工件及其整个目录 - Delete artifacts and their entire directory from maven local repository 如何使用远程存储库中的新工件更新maven本地存储库? - How to update maven local repository with newer artifacts from a remote repository? 从Maven存储库读取工件 - Reading artifacts from a maven repository 如何防止覆盖 hudson 上的 Maven 存储库中已发布的工件(非快照版本) - How to prevent overwriting of released artifacts (non snapshot versions) in maven repository on hudson 在 Linux 上托管的 Sonatype Nexus 存储库上部署 Maven 工件 - Deploy Maven artifacts on Sonatype Nexus repository hosted on Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM