简体   繁体   English

Intellije不向类路径添加依赖项

[英]Intellije not adding dependencies to class path

For some reason in Intellije Community Edition 14, the maven dependencies are not being found. 由于某些原因,在Intellije Community Edition 14中,找不到maven依赖项。

找不到依赖项

Maven没有下载文件

I have tried uninstalling and re-installing, I have tried re-importing the maven pom.xml, I have tried deleting all .idea and .iml files, I have tried Re-importing the project through intellije, I have tried deleting the entire project directory and re-downloading from git, and finally I have even tried running the code through maven - nothing is fixing my IDE! 我尝试卸载并重新安装,我尝试重新导入maven pom.xml,我尝试删除所有.idea和.iml文件,我尝试通过intellije重新导入项目,我尝试删除整个项目项目目录并从git重新下载,最后我什至尝试通过maven运行代码-没有任何东西可以修复我的IDE! Please help! 请帮忙!

I actually figured out an even better solution. 我实际上想出了一个更好的解决方案。

My project actually has a fairly complex POM which has parents of other POMs and a complex structure that Intellij didn't like for reasons unknown (Maven compiles worked on command line but Intellij couldn't resolve the POM). 我的项目实际上有一个相当复杂的POM,它具有其他POM的父对象,以及一个复杂的结构,由于未知的原因,Intellij不喜欢该结构(Maven编译在命令行上工作,但是Intellij无法解析POM)。

Because of this, no updates would happen, even after updating the workspace. 因此,即使在更新工作区之后也不会发生任何更新。

However, if you simply comment out the lines Intellij doesn't understand, you dependencies will be downloaded correctly. 但是,如果仅注释掉Intellij不理解的行,则依赖关系将被正确下载。 In my case, I just commented out my parent POM and all was well! 就我而言,我只是注释掉了我的父POM,一切都很好!

You should ultimately try to figure out what is causing said issue, but this will allow you to continue working. 您最终应该尝试找出导致上述问题的原因,但这将使您能够继续工作。

I just created a new workspace so no configs previously messed up were used. 我刚刚创建了一个新的工作区,所以没有使用以前弄乱的配置。 Problem solved! 问题解决了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM