Child pages
  • Maven Repo Cleaner Plugin
Skip to end of metadata
Go to start of metadata

Plugin Information

View Maven Repository Scheduled Cleanup on the plugin site for more information.

Clean your jobs maven repositories.

Known issues

How it works

Global configuration

Allows you to schedule a clean up of your local maven repositories.

Project configuration

History

Version 1.1 (Not released yet)
Version 1.2 (April 24, 2012)
  • alternative strategy to cleanup the repo for all artifacts not used during the build (require last access time support on filesystem)
  • fix NullPointerException saving empty configuration (JENKINS-12978)
Version 1.0 (Aug 2,2011)
  • First version

3 Comments

  1. I don't understand the options of the Expiration Style here.

    1) I don't get what "7" days "Since repository creation" means? Is everything removed from the Repo after 7 days. Does this work for project specific maven repos as well?
    2) I don't get what "7" days "Since repository last changed" means. Is it really the date when the last artifact was either being created or touched there? That will almost never work for CI builds, which get triggered with every commit
    3) I don't get what "Regardless of repository age means". Is expiration days in this case irrelevant. So every time this job runs, everything is removed?

    Basically what I want is to remove all SNAPSHOTs (optionally except for the most recent 2 ones for each artifact)? Is that currently feasible?

    1. I had the same questions as you and decided to look at the source code which is at: https://github.com/jenkinsci/maven-repo-cleaner-plugin

      See the method "process" around line 116 of MavenRepoCleanerThread.java

      From what I understand, this plugin only cleans up the repositories stored in the job directory when your Jenkins master configuration has per-job maven repositories selected, ie:

      Maven Project Configuration
      Local Maven Repository*   * Local to the workspace

      It won't therefore have any effect on Default (~/.m2/repository) or Local to the executor (JENKINS-DIR/maven-repositories/0...n] repositories.

  2. How to use this plugin, how to check if global configurations works, do I have to define any special job?