You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "jira-importer (via GitHub)" <gi...@apache.org> on 2025/04/02 08:48:09 UTC
[I] [MINSTALL-79] install:install should remove leftovers from local repository [maven-install-plugin]
jira-importer opened a new issue, #250:
URL: https://github.com/apache/maven-install-plugin/issues/250
**[Petr Kozelka](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=pkozelka)** opened **[MINSTALL-79](https://issues.apache.org/jira/browse/MINSTALL-79?redirect=false)** and commented
It 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. 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
---
**Attachments:**
- [pom.xml](https://issues.apache.org/jira/secure/attachment/12716628/pom.xml) (_1.30 kB_)
**Issue Links:**
- [MINSTALL-78](https://issues.apache.org/jira/browse/MINSTALL-78) install:install should remove leftovers from local repository
(_**"duplicates"**_)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [MINSTALL-79] install:install should remove leftovers from local repository [maven-install-plugin]
Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #250:
URL: https://github.com/apache/maven-install-plugin/issues/250#issuecomment-2771860723
**[Petr Kozelka](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=pkozelka)** commented
sorry this seems to land in a bad project... MINSTALL-78 is the right one
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org