mavenarchiva

How to configure Maven or Apache Archiva that it keeps only N builds of an snapshot


Our Archiva Repository never deletes old Snapshots. That generates a lot of garbage.

Is it possible to tell Archiva to keep only N builds of an Snapshot?

Best Regards, Christian.


Solution

  • Please go through http://archiva.apache.org/docs/2.2.0/adminguide/repositories.html

    You will find following

    repository purge by days older - the first option for repository purge. Archiva will  check how old the artifact is and if it is older than the set number of days in this field,  then the artifact will be deleted respecting the retention count (see #7) of course. In order to disable the purge by number of days old and set Archiva to purge by retention count, just set the repository purge field to 0. The maximum number of days which can be set here is 1000. See the Repository Purge section below for more details.
    repository purge by retention count - the second option for repository purge. When running the repository purge, Archiva will retain only the number of artifacts set for this field for a specific snapshot version. See the Repository Purge section below for more details. 
    delete released snapshots - specifies whether to remove those snapshot artifacts which already has release versions of it in the repository during repository purge.