Clear Old Indexes From Sonatype Nexus

We use Sonatype Nexus 1.9.2.2 to proxy maven repositories. Our problem is that indexes eat up so much disk space. All our storages occupy about 25 GB of space and grow.

For example, this directory has ~ 4 GB of index files, for example:

sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.825.gz sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.826.gz sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.827.gz sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.828.gz ... 

Is there any clean way to clean these files? For example, using a scheduled task?

Thanks in advance!

+7
source share
2 answers

We run the "optimize repository index" weekly, and also run the "empty garbage" task more often.

I can tell you that for us it is not a problem to store indexes. We have tons of files in these .index directories, but they are all under 1K ... even for our central proxy repository. Our total capacity is ~ 1 GB.

However, our repo is quite large. However, we have a lot of artifacts. We are currently located on a drive with a capacity of about 300 GB.

+4
source

Having stumbled upon the same problem, I even tried to talk with Sonatype.

They told me to simply delete the files and rebuild the indexes.

+1
source

All Articles