IntelliJ not resolving Maven dependencies

Answered

Hi everybody !

I'm having a problem with IntelliJ. It's not resolving Maven dependencies (the External Libraries remains empty and all classes from dependencies are red in the editor). When using clean install with the Maven plugin or via the command line it works though.

 

I already tried to :

  • Reimport the project with Maven
  • Invalidate the cache and restart IntelliJ
  • Delete the .idea folder and the .iml files
  • Delete my maven repository folder
  • Update the maven repositories indices in IntelliJ
  • Delete the maven folder in IntelliJ configuration folder

As none of this worked I'm beginning to think I won't find a solution.

 

Here is my pom.xml:

<?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>
<artifactId>libraries-apache-commons</artifactId>
<name>libraries-apache-commons</name>

<parent>
<artifactId>parent-modules</artifactId>
<groupId>com.baeldung</groupId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${commons-text.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<dependency>
<groupId>commons-chain</groupId>
<artifactId>commons-chain</artifactId>
<version>${commons-chain.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>${commons-csv.version}</version>
</dependency>
<dependency>
<groupId>commons-dbutils</groupId>
<artifactId>commons-dbutils</artifactId>
<version>${commons.dbutils.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>${common-math3.version}</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>${commons-net.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
</dependency>
<dependency>
<groupId>org.knowm.xchart</groupId>
<artifactId>xchart</artifactId>
<version>${xchart-version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons.collections.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
<version>${org.hamcrest.java-hamcrest.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<properties>
<commons-lang.version>3.6</commons-lang.version>
<commons-text.version>1.1</commons-text.version>
<commons-beanutils.version>1.9.3</commons-beanutils.version>
<commons-chain.version>1.2</commons-chain.version>
<commons-csv.version>1.4</commons-csv.version>
<assertj.version>3.6.2</assertj.version>
<commons.io.version>2.5</commons.io.version>
<commons.dbutils.version>1.6</commons.dbutils.version>
<commons.collections.version>4.1</commons.collections.version>
<org.hamcrest.java-hamcrest.version>2.0.0.0</org.hamcrest.java-hamcrest.version>
<commons-codec-version>1.10.L001</commons-codec-version>
<xchart-version>3.5.2</xchart-version>
<commons-net.version>3.6</commons-net.version>
<common-math3.version>3.6.1</common-math3.version>
</properties>

</project>

 

I also attach a printscreen of my IntelliJ:

 

I also uploaded the IntelliJ log folder using the webform. The filename is log.zip.

 

I'm using version 2019.1.2 of IntelliJ.

 

Thanks a lot,

François

2
32 comments

Also affected. I have a multi-moduled maven Project and the issue appears only in one submodule.

The issue started to happen when I switched back and fourth between git branches (some of those branches had the module in question and some not).

Now I cannot get it working not matter how many times I reload maven project or invalidate my caches. IntelliJ is almost unusable like this.

Please fix this.

IntelliJ IDEA 2024.2.3 (Ultimate Edition

Build #IU-242.23339.11, built on September 25, 202
 

0

Hello,

Could you please check the issue with 2024.3 EAP: https://www.jetbrains.com/idea/nextversion/ ?

0

Please sign in to leave a comment.