Customized clean-up policy - Sonatype Nexus Repository - Sonatype Community
Customized clean-up policy
post by verilerlehayat on Feb 19, 2024
I am using Sonatype Nexus RepositoryOSS 3.61.0-02. I have configured a clean-up policy such that artifacts are deleted after 30 days (Published Before). That works fine and deletion works. I am wondering if it is possible to somehow configure such that at least one last version is always retained irrespective of the number of days.
e.g. uploaded 5 versions of an artifact to repository. Configured 30 days policy. On day 31, all 5 versions will be removed. What I am looking for is that even after day 30, at least one last version should remain as that was the last known version available for that artifact.
Is this possible ?
post by mprescott on Feb 19, 2024
This is possible with Nexus Pro, for maven and Docker. You can retain the n most recent versions and allow the others to be cleaned up. Which format(s) are you needing this for?
post by verilerlehayat on Feb 20, 2024
Hey thanks, is there way to do this on free version?
post by mprescott on Feb 20, 2024
Unfortunately not, @verilerlehayat.
post by y64n on Sep 8, 2025
And I have the opposite problem: I don’t want to delete the artifacts, but they are being deleted automatically. Leaving only 5 latest tags. That is the case with Nexus OSS 3.66 at mine with docker repo, which has no Cleanup policy nor Delete unused images tasks bound to it.
I’ve exhausted all the ideas - anyone could hint at why the deletion happens anyway?