Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
283 views
in Technique[技术] by (71.8m points)

java - How to limit number of deployed snapshots artifacts in Nexus?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Create a scheduled task to purge out old snapshots.

The following links describe the functionality:

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...