在IntelliJ中,Maven无法解析依赖关系

时间:2020-05-29 23:05:30

标签: maven intellij-idea maven-3

现在,我在Maven中显示的依赖项上出错。

我尝试了Intellij idea cannot resolve anything in maven此处列出的操作,例如更改Maven主目录和自动选择导入Maven。我不确定还有什么可能... 另外,该项目最初是在Eclipse中完成的。

2 个答案:

答案 0 :(得分:1)

您可以尝试使用以下命令强制下载依赖项:

mvn clean install -U

或者您可以按Ctrl+Shift+A(win / linux)或Command+shift+A(mac)查找操作,键入“重新导入”,然后选择“重新导入所有Maven项目”。

在用户界面中:

enter image description here

答案 1 :(得分:0)

如果完成mvn clean install的操作,只需单击此图标。

enter image description here

如果在极少数情况下您仍然遇到问题类型命令 mvn -U idea:idea(不推荐使用,但可以完成工作)。