How to View Maven Dependency Tree and Resolve JAR Conflicts in IntelliJ IDEA

This guide shows how to inspect Maven's dependency tree using IntelliJ IDEA's built‑in tool, the command line, or the Maven Helper plugin, identify version conflicts, and resolve them with exclusions or dependencyManagement entries.

Java Companion
Java Companion
Java Companion
How to View Maven Dependency Tree and Resolve JAR Conflicts in IntelliJ IDEA

1. View Dependency Tree

Method 1: IDEA built‑in Maven tool

Open the Maven tool window (Alt+Shift+M → View → Tool Windows → Maven).

Expand the Dependencies node of your project.

The full tree is displayed; conflicting jars appear in gray or red.

Hover a dependency to see which parent introduced it.

Method 2: Command line mvn dependency:tree Sample output:

[INFO] org.example:dependency-test:jar:1.0-SNAPSHOT
[INFO] +- org.springframework:spring-webmvc:jar:6.0.9:compile
[INFO] |  +- org.springframework:spring-beans:jar:6.0.9:compile
[INFO] |  +- org.springframework:spring-context:jar:6.0.9:compile
[INFO] |  +- org.springframework:spring-core:jar:6.0.9:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:6.0.9:compile
[INFO] |  +- org.springframework:spring-expression:jar:6.0.9:compile
[INFO] |  \- org.springframework:spring-web:jar:6.0.9:compile
[INFO] |     \- io.micrometer:micrometer-observation:jar:1.10.7:compile
[INFO] |        \- io.micrometer:micrometer-commons:jar:1.10.7:compile
[INFO] \- org.springframework:spring-aop:jar:5.3.23:compile

To filter the tree, add -Dincludes=org.springframework:

mvn dependency:tree -Dincludes=org.springframework

Method 3: Maven Helper plugin (recommended)

Install the Maven Helper plugin from the IDEA marketplace. Open pom.xml and a Dependency Analyzer tab appears, offering:

One‑click view of the dependency tree

Highlighting of conflicting jars

Right‑click to Exclude a dependency

2. Identify Conflicting JARs

Search the tree for the same groupId + artifactId with different versions, e.g.:

org.springframework:spring-beans:6.0.9
org.springframework:spring-beans:5.3.23 (omitted for conflict)

This indicates a version clash. Maven selects the shortest path (nearest to the project) by default, but you may need to intervene when the chosen version is not desired.

3. Resolve Conflicts (exclusion)

In pom.xml, locate the upstream dependency that brings the conflict and add an exclusion:

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-webmvc</artifactId>
  <version>6.0.9</version>
  <exclusions>
    <exclusion>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
    </exclusion>
  </exclusions>
</dependency>

If only the version differs, enforce the desired version in dependencyManagement:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>5.3.23</version>
    </dependency>
  </dependencies>
</dependencyManagement>

4. Summary

Quickly view the dependency tree via IDEA or mvn dependency:tree.

Efficiently locate conflicts using the Maven Helper plugin.

Resolve conflicts by adding exclusion entries or by forcing versions in dependencyManagement.

mavenIntelliJ IDEAdependencyManagementjar conflictdependency treeexclusionMaven Helper
Java Companion
Written by

Java Companion

A highly professional Java public account

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.