IntellijIDEA not recognizing classes specified in Maven dependencies

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


After installing IntelliJ IDEA on a new computer I found myself with the same issue.

I had to update the remote maven repository. (Settings > Maven > Repositories)

enter image description here

Both local and remote repos needed to be updated. The remote one wasn't updated ever before this. After a restart everything worked fine. You might have to reimport your project.


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.


Right click on the pom.xml -> Add as Maven project -> Reimport

Maven import


I was running into similar issues. For me it ended up being that I was importing the project incorrectly. I had been doing

import project
    <navigate to existing project and click top level directory>
    follow the wizard

What solved my maven problems was to do

import project
    <navigate to existing project and click the pom.xml
    follow the wizard