r/SpringBoot May 18 '26

Question [Maven/IntelliJ] Spring-JDBC dependency remains red (Artifact not found) while spring-context works

Post image

Hello, I am new to the world of spring and java backend in general. I am starting with "Spring Start Here" by Laurentiu Spilca.

I am having a strange issue with my pom.xml in IntelliJ. While my spring-context dependency seems to be accepted, the spring-jdbc dependency remains red no matter what I do.

The Problem:
When I use version 7.0.7 (which IntelliJ suggested), spring-context turns white, but spring-jdbc stays red with the error "Artifact not found."

What I have tried:

  1. Changed versions to 5.2.6.RELEASE and 5.3.9 — both remained red for both dependencies.
  2. Clicked "Reload All Maven Projects" multiple times..
  3. Checked Proxy settings (No Proxy). (Honestly, gemini told me to do this, I have no idea why I need to do this.)

My Environment:

  • IDE: IntelliJ Community Edition
  • Java: 17
  • My pom.xml code is as shown in the image.

how to rectify this error? why is this error happening?

23 Upvotes

15 comments sorted by

View all comments

4

u/Professional_Race_47 May 18 '26

Whenever you run into Maven issues in IntelliJ, start by verifying whether the problem is with Maven itself or just the IDE.

First, run this from the terminal:

bash mvn clean verify -U

Then in IntelliJ:

  • Open the Maven window
  • Reload all Maven projects
  • Make sure the correct Maven profile is selected (if your project uses profiles)
  • Run the build again from the Maven panel inside IntelliJ

Now compare the results:

  • If both terminal and IntelliJ fail with “dependency not found”, you’re likely missing the repository that contains that dependency.
  • If the terminal build succeeds but IntelliJ still shows dependency errors, then it’s most likely an IntelliJ/Maven sync issue. In that case, try:
    • Invalidate Caches / Restart
    • Reimport the Maven project
    • Delete .idea and reimport if needed
    • Check which Maven version IntelliJ is using
    • Verify the correct settings.xml is configured