如何从本地Maven存储库中删除项目工件? [英] How to do remove a projects artifacts from the local maven repo?
问题描述
在本地多模块项目上运行mvn install
时,它将构建并将项目工件安装到本地存储库中. mvn clean
似乎正在清理我的项目特定的目标目录.
When running mvn install
on a local multi module project it builds and install the projects artifacts into the local repo. mvn clean
seems to clean up my project specific target directories.
我如何与maven一起使用什么命令来使其从本地存储库中卸载项目模块?例如,我的项目输出foo-0.1.jar和bar-0.2.jar,我希望将它们从本地存储库中删除,而不必进入本地并将其删除.
What command do I use with maven to get it to uninstall my projects modules from the local repo? for example my projects outputs foo-0.1.jar and bar-0.2.jar I want those removed from my local repo without having to go in there and delete them myself.
推荐答案
您可以从本地存储库中清除工件,但是为什么要这样做呢?除此之外,您还可以通过 maven-依赖插件:
You can purge artifacts from your local repository, but why do you like to do this? Apart from that you can do that via maven-dependency-plugin:
这将清除所有项目和依赖项目
This will purge all project- and dependency artifacts
mvn dependency:purge-local-repository -DreResolve=false
这可能会受到补充命令行参数(请参阅文档)的影响,以获取更多详细信息.
This can be influenced by supplemental command line arguments (see the documentation) for further details.
这篇关于如何从本地Maven存储库中删除项目工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!