Intellij idea cannot resolve anything in maven

Burst picture Burst · Mar 31, 2013 · Viewed 175.1k times · Source

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...

Answer

MCP picture MCP · Aug 5, 2013

In IntelliJ 12.1.4 I went through Settings --> Maven --> Importing and made sure the following was selected:

  1. Import Maven projects automatically
  2. Create IDEA modules for aggregator projects
  3. Keep source...
  4. Exclude build dir...
  5. Use Maven output...
  6. Generated souces folders: "detect automatically"
  7. Phase to be...: "process-resources"
  8. Automatically download: "sources" & "documentation"
  9. Use Maven3 to import project