Home > database >  How to find overlap dependencies in a Gradle or Maven Project
How to find overlap dependencies in a Gradle or Maven Project

Time:10-05

I have a Spring Boot Project with this two Dependencies.

id 'org.springframework.boot' version '2.7.2'
....
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'com.google.code.gson:gson:2.8.8'

My problem here is that Eureka client brings gson dependency 2.9 into the project. So at least the version 2.8.8 specification is useless here.

I want to keep the gradle file clean. Is there an easy way to find dependency overlaps like this?

I have exactly the same situation in my Maven project. A solution for Maven would be nice too.

CodePudding user response:

run: gradle dependencies

You will get a tree showing where all of the dependencies come from and which have been overruled by later versions.

See the documentation at https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html

The solution I would use for Maven is to convert it to a Gradle project to make my life easier for this and everything else to come.

  • Related