IntelliJ IDEA Learnings 1 — Spring Boot dependencies not getting resovled

BitLrnr
2 min readNov 1, 2023

--

When you are working on Software Projects you encounter things that used to work fine in your earlier experience but now seem to give issues, taking time from your assigned tasks. This is not just the classical production behavior being different than what happened in your local testing that new to software engineers complain ( please free to smile), it can be as simple as you created a project using your favorite IDE (Integrated Development Environment e.g. IntelliJ IDEA, PyCharm, Visual Studio, Eclipse) following usual steps, which you did N times before, and now the project is not resolving dependencies.

This happened to me recently when I was trying to create a fresh spring boot project in IntelliJ IDEA IDE.

The project — A Spring Boot App (gradle based) didn’t resolve spring boot dependencies in IntelliJ. Jotting down the resolution in case someone finds it helpful.

Symptom: Spring Boot Gradle Project not resolving dependencies

I started seeing all red marks in the project for Spring Boot annotations etc. due to dependencies not getting resolved.

Resolution:

One of the following steps may be your potential reason (not in order). This is the order of troubleshooting I followed.

0. Wait for any indexing to complete once you open the project files to complete.

  1. Check if Gradle is installed. Go to console/terminal and type gradle to see if its being recognized. Else install Gradle following steps based on your OS (Ref: https://gradle.org/install/).

2. Check that the “build and run using” setting of the IntelliJ IDEA is setup as Grade (which should be by default if you open a Grade based Spring Boot project as shown below). This you can find in IntelliJ IDEA → Settings

3. Try invalidating cache of IntelliJ and restart the project. You can get to it as shown below from File -> Invalidate Cache.. — select all applicable check boxes and click “Invalidate and Restart”

4. Try deleting the hidden Gradle cache folder <<.gradle>> from the project folder, close and open the project again in intelliJ

In my case, it looks like the last step seems to have made it work.

That’s all for now. Happy Coding!

--

--

BitLrnr
0 Followers

Learning things a bit, byte, word, KB.....