u/Potential_Spot_5847

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

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

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?

u/Potential_Spot_5847 — 2 days ago

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

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:

​

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.example</groupId>
  <artifactId>new_maven</artifactId>
  <version>1.0-SNAPSHOT</version>

  <dependencies>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>7.0.7</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>7.0.7</version>
    </dependency>
  </dependencies>

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
  </properties>

</project>

the error it is showing is in this part

<artifactId>spring-jdbc</artifactId>
<version>7.0.7</version>

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

reddit.com
u/Potential_Spot_5847 — 2 days ago