maven-2package-managerssonatypenexus3artifact

Cleanup Nexus Repository for old cached components


I have a nexus server and while monitoring it I found out that nexus is using 500 GB in Server. I was shocked to see that as I had an Idea that size of our artifacts would be around 30 GB. And I was right, checking on DB I found that size used was about 26 GB.

While trying to figure out I found out a setting Allow Redeploy in release repositories. So what is happening is whenever a redeploy the new artifact is replacing the old one but the old one is not getting deleted. It is cached somewhere. How can I delete that cached data to clear out some space?


Solution

  • Ok So I found the solution for this On nexus Documentation. As the below link mentions different cleanup policies. I found that Cleanup Policies does what is called a soft-delete i.e marked for deletion. Which will not clean up the space. To cleanup we have to perform a task known as Admin - Compact Blob Store.

    Go to "System -> Tasks -> Create Task", select the "Admin - Compact Blob Store" task, select the blob store of your repository and configure this task to run.

    https://help.sonatype.com/repomanager3/repository-management/cleanup-policies