Customized clean-up policy

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 ?

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?

Hey thanks, is there way to do this on free version?

Unfortunately not, @verilerlehayat.