I have a project in IntellijIDEA which was created with Maven. I then specified a set of dependencies and external repositories in the Pom.xml file.
The project builds fine on command line if I do "mvn install". When I open any of the code files in the IDE though it says all the classes handled by Maven dependencies aren't recognized - as it would for a normal project if I never added the required JARs to the build path.
I know in my Eclipse Maven projects (rather than IntelliJ) it usually shows an extra directory on the left which says "Maven Dependencies" and lists the JARs pulled in via maven. I don't see that here. What am I doing wrong?
Here's what my screen looks like:
For me the problem seems to be a conflict with the maven helper plugin (https://plugins.jetbrains.com/plugin/7179?pr=idea).
I disable it, and it works again :)
Go to File > Settings > Build, Execution, Deployment > Build Tools > Maven and check the Maven home directory. This should be the same maven installation used for command line
Might be useful to others that were still stuck like me. None of the suggested fix worked. Actually, not before I fixed my main problem which was the installation location of maven.
In my case, I did not use the standard location. Changing that location in the maven settings (Settings/Maven/Maven home repository) did the trick.
My 2 cents.
For me File>>Invalidate Cache/Restart>>Invalidate and Restart worked in IntelliJ
You could go to:
File > Settings > Build, Execution, Deployment > Build Tools > Maven
and check if your pom.xml is not in the "Ignored Files" list.
For some reason re-import did not do the trick. After looking at this:
http://www.jetbrains.com/idea/webhelp/maven-importing.html
I set auto-import and then the problem went away though; hopefully it helps someone else. Thanks for the ideas everyone :).