Issue
I have a Spring Project in which I am using Maven to manage my dependencies. I have some (5 to 10) packages mentioned inside the POM-File and Maven is successfully downloading them into my local repository.
But IntelliJ is not recognizing these packages. Not even the SpringBoot-Packages.
I have tried different things:
- Delete local Maven-Repository
- Create a new Project inside IntelliJ from existing Sources but with the same Directory as the original Project
- Create a new Project inside IntelliJ from existing Sources but I have copied the
src
-Folder and the POM-File to a new Directory first
Why is IntelliJ not recognizing the Maven-Dependencies?
P.S.: The Maven-Build is successful. So Maven IS recognizing the packages inside the repository.
Solution
IntelliJ seems to handle an Index for all dependencies inside the project. And this Index was not correctly handled in my case by IntelliJ.
But I found out that I can manually clear this cache/index by using following function:
File > Invalidate Caches / Restart...
Answered By - Snickbrack
Answer Checked By - Mary Flores (JavaFixing Volunteer)