Intellij 的想法无法解决 Maven 中的任何问题 [英] Intellij idea cannot resolve anything in maven
问题描述
我是 Intellij Idea 的新手,我只是用 pom.xml
导入了一个项目,但是 ide 没有解决任何 maven 依赖项.
I'm new to Intellij Idea, i just import a project with pom.xml
, but the ide didn't resolve anything in maven dependencies.
pom.xml
依赖项中定义的任何内容在代码中导入时引发错误 cannot resolve symbol xxxxx
Anything defined in pom.xml
dependencies when import in code raise an error cannot resolve symbol xxxxx
但是 mvn install
会起作用,我尝试在 .jar
文件中的 Project Settings/Libraries
中导入依赖项,然后它起作用了,但是ide 可以解析 pom.xml
中定义的库吗?我不想每次都这样做.
But mvn install
will work, i try import the dependencies in Project Settings/Libraries
in .jar
files, then it works, but could the ide resolve libraries defined in pom.xml
? i don't want to do that everytime.
附加信息:
IDEA 版本:12.0.3,操作系统:windows 7,重新导入不起作用,maven 版本:3.0.4,Exernal Libraries 下不存在 maven 依赖项.
IDEA version: 12.0.3, OS : windows 7, reimport does not work, maven version : 3.0.4, maven dependencies does not exists under Exernal Libraries.
idea.log 中没有异常...
there is no exceptions in idea.log...
推荐答案
我遇到了这个问题,idea无法使用maven下载所有依赖的jar包,我只是尝试了以下操作:
I have encountered this problem,idea cannot download all dependent jar packages using maven,i just tried the following operations:
mvn -U idea:idea
然后从maven仓库下载所有依赖的jar包
then all the dependent jar packages are download from the maven repository
这篇关于Intellij 的想法无法解决 Maven 中的任何问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!