sonatype / nexus-public

Sonatype Nexus Repository Open-source codebase mirror
https://www.sonatype.com/products/repository-oss-download
Eclipse Public License 1.0
1.83k stars 557 forks source link

Feature request: Option to exclude the latest version of each artifact from Cleanup Policies #400

Open beppo-sturmtief opened 1 month ago

beppo-sturmtief commented 1 month ago

In NR OSS, Cleanup Policies are limited to filtering a) name based, b) based on artifact age and c) based on activity (age of last download of the artifact).

This leads into problems with stable artifacts - if one is not rebuild & deployed (and is cached in all local maven repos) for longer than the cleanup policy, the artifact gets deleted and is no longer available from the repo.

This issue is actively preventing me from employing automatic cleanup policies, thereby effectively keeping my repo overgrown and cluttered with outdated snapshot artifacts.

It was reported that a comprehensive feature to adress this in the works for NR PRO, but OSS users are excluded. Also notably, there was a feature in the free version of Nexus 2.

To relieve the issue for OSS users, i propose a minimal solution that also does not compete with the PRO feature: add a boolean option to the cleanup option to never remove the latest version of any artifact selected by the filter settings.

This would imo be a feature of limited scope, but would address the issue of stable artifacts for most non-power users.

See also issue #246 and others.

Would be greatly appreciated!

nblair commented 4 weeks ago

Thank you @beppo-sturmtief - we'll keep this enhancement idea open to track demand.