Uploaded image for project: 'Maven Install Plugin'
  1. Maven Install Plugin
  2. MINSTALL-78

install:install should remove leftovers from local repository

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.3.1
    • None
    • install:install
    • None

    Description

      It sometimes happens that we need to change the set of output artifacts. When this happens, the install mojo does not bother to remove older artifacts that are no longer produced by this module.

      The bad effect is, that other modules depending on the obsolete artifacts can still use it - and later there comes a surprise.
      Much better behavior in this situation would be, to remove the obsolete files from the local repository's directory dedicated for given module.

      reproducing the problem

      1. download the sample pom to an empty directory
      2. execute mvn clean install -Dc=obsolete-demo - this represents the "older version" of a module
      3. execute mvn clean install - this represents the "newer version" of a module, after changing the classifier
      4. now, look in the local repo using ls -1 $HOME/.m2/repository/demo/sample-zip-module/1-SNAPSHOT - you will see this:

        maven-metadata-local.xml
        sample-zip-module-1-SNAPSHOT-demo.zip
        sample-zip-module-1-SNAPSHOT-obsolete-demo.zip
        sample-zip-module-1-SNAPSHOT.pom

      possible solutions

      I see two approaches

      1. drop the installdir first - straightforward
      2. list installdir, install, drop leftovers - slightly more complicated but maximizes the time of installed module existence (if that matters)

      Attachments

        1. pom.xml
          1 kB
          Petr Kozelka

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              pkozelka Petr Kozelka
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: