Artifactory does not delete unique snapshots

We have an Artifactory server that uses 220Gb - with the libs-snapshots-local repository using 98% of this storage.

When we looked at the configuration for the repository, we noted that the value for the Maven snapshot was set to: unique and that the value of Max Unique Snapshots was 0 .

We changed the value of Max Unique Snapshots to 5.

This works when we are still working on the snapshot, however, if we no longer use the snapshot (the release was made), it does not delete any of these files.

As an example: in the Snapshots repository, we have the following:

 com/company/some/app/1.23-SNAPSHOT/.. (50+ artifacts) com/company/some/app/1.24-SNAPSHOT/.. (5 artifacts) 

Artifactory stores the current SNAPSHOT directory ( 1.24-SNAPSHOT ) with a maximum of 5 artifacts, but the number of artifacts in the 1.23-SNAPSHOT directory never decreases.

Artifactory seems to use artifact deployment to trigger a cleanup check. So, if you no longer use this artifact, will the cleaning fail?

How can we get Artifactory to start removing redundant artifacts in the 1.23-SNAPSHOT folder?

+5
source share
1 answer

You're right, deploying a new snapshot is a trigger for deleting old ones. Since your explosion of 1.23 artifacts remains the same (wrong) configuration, you are good from now on.

The easiest way to delete old pictures is to simply set another (even fictitious) picture to 1.23. This will cause a cleanup.

Another idea might be to create another repo of the snapshots and move the last 5 snapshots 1.23. Then you can safely delete folder 1.23 and move it from the temporary repo.

These are all valid cleanup options for one or more versions, but they will not scale. If you have many versions to clean up, I would recommend writing a simple custom plugin to execute .

You just get the children of the version catalog and delete everything except the few that you want to leave.

+2
source

Source: https://habr.com/ru/post/1210913/


All Articles