Maven
  1. Maven
  2. MNG-3472

configuration possibilities to limit size of local repository

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.8
    • Fix Version/s: None
    • Component/s: Settings
    • Labels:
      None
    • Number of attachments :
      0

      Description

      it would be great to make repository-size configurable, for instance by setting the maximum number of downloads of a snapshot-version to be kept. thus the explosion of local repository size can be reduced.
      especially when you are working with many in-house multi-module projects which are marked as snapshots before released , can increase repository size significantly.

      see mailing-list discussion: http://www.nabble.com/limit-size-of-local-repository%2C-limit-number-of-snapshots-td16147475s177.html

        Issue Links

          Activity

          Hide
          Brian Levine added a comment -

          Wow. I'm really surprised at the responses here. While it is true that CI systems could provide tools to clean out Maven local repos, this doesn't do much for the individual developer who finds that all of a sudden, his dev machine has run out of disk space. This seems like a perfect example of something that should be configurable in settings.xml with a default value that is fairly small. On a personal development machine especially, I see no reason why you'd want to keep old snapshot artifacts. I will post something to the mailing list to get this issue re-opened.

          Show
          Brian Levine added a comment - Wow. I'm really surprised at the responses here. While it is true that CI systems could provide tools to clean out Maven local repos, this doesn't do much for the individual developer who finds that all of a sudden, his dev machine has run out of disk space. This seems like a perfect example of something that should be configurable in settings.xml with a default value that is fairly small. On a personal development machine especially, I see no reason why you'd want to keep old snapshot artifacts. I will post something to the mailing list to get this issue re-opened.
          Hide
          Lo-Tan added a comment -

          I also think this should be a configured responsibility of Maven. Maven is the only client that knows how the repository should look, especially if it ever evolves and changes the structure. Leaving it up to external tools could corrupt repositories. I know right now the repository is straight forward, but still. The tool that generated it should know how to handle it.

          Show
          Lo-Tan added a comment - I also think this should be a configured responsibility of Maven. Maven is the only client that knows how the repository should look, especially if it ever evolves and changes the structure. Leaving it up to external tools could corrupt repositories. I know right now the repository is straight forward, but still. The tool that generated it should know how to handle it.
          Hide
          Eric Dalquist added a comment -

          It is unfortunate that this issue is marked as won't-fix. We run into this problem all the time and are starting to feel lots of pain around managing local repositories. Having some way to:

          • Purge all but the X newest snapshots of a version
          • Purge snapshots where a release exists in the local repo

          Is really critical, for now we'll be doing this via scripts which I'll try to post back here but of course the danger is the local repository meta data may be left in an invalid state since we'll just be deleting files.

          Show
          Eric Dalquist added a comment - It is unfortunate that this issue is marked as won't-fix. We run into this problem all the time and are starting to feel lots of pain around managing local repositories. Having some way to: Purge all but the X newest snapshots of a version Purge snapshots where a release exists in the local repo Is really critical, for now we'll be doing this via scripts which I'll try to post back here but of course the danger is the local repository meta data may be left in an invalid state since we'll just be deleting files.
          Hide
          cforce added a comment - - edited

          I think maven should provide at least the method to be able t purge the local repository similar to the nexus server option (number of snapshots, release and days to keep, delete spnaphosts if released), also this job must be triggered from external tool, like ej. jenkins or devscript.
          Would be great if someone can posts plugin or scripts which can do such work in the meantime.

          Here is my answer:
          http://stackoverflow.com/questions/1308263/wiping-out-maven-local-repository-on-build-machine

          Pleas repopen this issue.

          Show
          cforce added a comment - - edited I think maven should provide at least the method to be able t purge the local repository similar to the nexus server option (number of snapshots, release and days to keep, delete spnaphosts if released), also this job must be triggered from external tool, like ej. jenkins or devscript. Would be great if someone can posts plugin or scripts which can do such work in the meantime. Here is my answer: http://stackoverflow.com/questions/1308263/wiping-out-maven-local-repository-on-build-machine Pleas repopen this issue.
          Hide
          Eric Dalquist added a comment - - edited

          Here is what we are doing on our build server:

          find /path/to/.m2 -wholename '*SNAPSHOT/*.*' -type f -mtime +1 -print0 | xargs -r -0 rm -v
          find /path/to/.m2 -type d -empty -print0 | xargs -r -0 rmdir -v
          

          That deletes any files in a SNAPSHOT directory older than 1 day and then deletes all empty directories.

          Show
          Eric Dalquist added a comment - - edited Here is what we are doing on our build server: find /path/to/.m2 -wholename '*SNAPSHOT/*.*' -type f -mtime +1 -print0 | xargs -r -0 rm -v find /path/to/.m2 -type d -empty -print0 | xargs -r -0 rmdir -v That deletes any files in a SNAPSHOT directory older than 1 day and then deletes all empty directories.

            People

            • Assignee:
              Unassigned
              Reporter:
              manuel aldana
            • Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: