如何强制maven更新本地回购 [英] how to force maven to update local repo

查看:192
本文介绍了如何强制maven更新本地回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个项目中编译了一个jar文件,因此可以在第二个项目中使用它。我可以在.m2文件夹中看到jar文件。但在第二个项目中,它抱怨找不到工件。
我想我必须强制maven更新索引/缓存一些但不知道到底是什么。任何提示,谢谢。

I compiled a jar file in one project so it can be consumed in the 2nd one. I can see the jar file in .m2 folder. But in the 2nd project it complains about artifact not found. I guess I have to force maven to update indices/cache something but don't know what exactly. Any tip, thanks.

更新:感谢所有好建议。
原来第二个项目中的maven插件(IntelliJ)不会更新其索引。我使用命令行编译好了。

Update: thanks for all good suggestions. Turns out that the maven plugin (of IntelliJ) in the second project doesn't update its index. I use command line it compiled ok.

推荐答案

如果要安装到本地存储库,则不需要特殊的索引/缓存更新。

If you are installing into local repository, there is no special index/cache update needed.

确保:


  1. 您已在本地存储库中正确安装了第一个工件。只需将文件复制到 .m2 可能无法正常工作。确保通过 mvn install

  1. You have installed the first artifact in your local repository properly. Simply copying the file to .m2 may not work as expected. Make sure you install it by mvn install

正确设置了第二个项目中的依赖项。检查 groupId / artifactId / version 中的任何拼写错误,或者不匹配的工件 type / classifier

The dependency in 2nd project is setup correctly. Check on any typo in groupId/artifactId/version, or unmatched artifact type/classifier.

这篇关于如何强制maven更新本地回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆