I'm new to Intellij Idea, i just import a project with pom.xml
, but the ide didn't resolve anything in maven dependencies.
Anything defined in pom.xml
dependencies when import in code raise an error cannot resolve symbol xxxxx
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.
Additionnal info:
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.
there is no exceptions in idea.log...
In IntelliJ 12.1.4 I went through
Settings --> Maven --> Importing
and made sure the following was selected:This took me from having a lot of unresolved import statements to having everything resolved. I think the key here was using Maven3 to import project... Hopefully this helps.
Just encountered the same problem after IntelliJ update. My fix: right click on the project, then maven -> reimport.
I was also getting this error because the project imported main and test folders as modules. Click on Project --> Press F4 --> In Module settings, remove main and test folders and the make the project again. Problem will be resolved.
To me the problem what that I had to check the box "Import maven projects automatically" under Setting> Maven>Importing
If you imported your maven project in IntelliJ and there are errors because of maven imports not getting resolved, it maybe because of the custom maven settings.xml you may be using. I tried overriding it in the Intellij default maven settings but it did not help. Finally I had to keep it in ~/.m2/settings.xml and then IntelliJ finally honored it.