Nexus Repository 2 officially sunsetted June 30, 2025. Visit my.sonatype.com for archived documentation. Migrate to Sonatype Nexus Repository 3 as soon as possible.
Nexus Repository 2 does include some tooling to help you cleanup artifacts, namely in the form of scheduled tasks. These tasks include:
- Drop Inactive Staging Repos
- Evict Unused Proxied Items From Repository Caches
- Remove Snapshots from Repository
- Remove Unused Snapshots From Repository
- Remove Releases From Repository
- Drop Inactive Staging Repositories
Many of these tasks simply move items to the Nexus Repository 2 specific trash directory, so a final cleanup can be scheduled with the Empty Trash Task. Also, for removing old release artifacts, it is advisable to consider the items in this knowledge base article.
Additionally the following tasks may optimize the disk space consumed by search indexes:
- Optimize Repository Index
- Purge Nexus Timeline
- Repair Repositories Index - this will rebuild index from scratch.
Information about managing scheduled tasks can be reviewed in our documentation.