日食中的Maven依赖问题 [英] Maven dependency issue in eclipse

查看:92
本文介绍了日食中的Maven依赖问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在eclipse中的工作空间中打开了多个相关项目。其中一个项目对另一个项目的输出jar有一个maven依赖。在这个项目中,对依赖关系中的类的任何引用总是显示为红色(不明),我没有显示代码完成或者显示它们的javadoc。如果我手动添加jar到类路径,那么我不再有这个问题。事情是,我不想在每次修改修改时手动添加jar,这就是Maven所用的。关于我如何解决这个问题的任何想法?对我来说似乎是一个错误,但我不确定...

解决方案

我有同样的问题,解决了通过右键单击项目并从上下文菜单中选择Maven - > Disable Workspace Resolution。我已经尝试从POM文件中更新项目,如上所述。


I have multiple related projects open in a workspace in eclipse. One of the projects has a maven dependency on the output jar from another project. In this project, any references to the classes in the dependency always show up as red (unidentified) and I get no code completion or javadoc showing up for them. If I manually add the jar to the classpath, then I no longer have this problem. The thing is, I don't want to have to manually add the jar every time our revision changes, that's what Maven is for. Any ideas on how I can resolve this? it seems like a bug to me, but I'm not sure...

解决方案

I had the same issue and resolved the problem by right-clicking on the project and selecting Maven -> Disable Workspace Resolution from the context menu. I had already tried updating the project from the POM file as described above.

这篇关于日食中的Maven依赖问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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