[
https://issues.apache.org/jira/browse/MINSTALL-78?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17965964#comment-17965964
]
Olivier Lamy commented on MINSTALL-78:
--------------------------------------
This project has moved from Jira to GitHub Issues. This issue was migrated to
[apache/maven-install-plugin#189|https://github.com/apache/maven-install-plugin/issues/189].
> install:install should remove leftovers from local repository
> -------------------------------------------------------------
>
> Key: MINSTALL-78
> URL: https://issues.apache.org/jira/browse/MINSTALL-78
> Project: Maven Install Plugin (Moved to GitHub Issues)
> Issue Type: Bug
> Components: install:install
> Affects Versions: 2.3.1
> Reporter: Petr Kozelka
> Assignee: Robert Scholte
> Priority: Major
> Attachments: pom.xml
>
>
> 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.
> h4. reproducing the problem
> # download the sample pom to an empty directory
> # execute {{mvn clean install -Dc=obsolete-demo}} - this represents the
> "older version" of a module
> # execute {{mvn clean install}} - this represents the "newer version" of a
> module, after changing the classifier
> # now, look in the local repo using {{ls -1
> $HOME/.m2/repository/demo/sample-zip-module/1-SNAPSHOT}} - you will see this:
> {quote}
> maven-metadata-local.xml
> sample-zip-module-1-SNAPSHOT-demo.zip
> {color:red}sample-zip-module-1-SNAPSHOT-obsolete-demo.zip{color}
> sample-zip-module-1-SNAPSHOT.pom
> {quote}
> h4. possible solutions
> I see two approaches
> # *drop the installdir first* - straightforward
> # *list installdir, install, drop leftovers* - slightly more complicated but
> maximizes the time of installed module existence (if that matters)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)