I'm looking for a way to find dependency conflicts in 3rd party libraries. I'm aware of mvn dependency:tree, its -Dverbose and -Dincludes options. This works well but has a couple of drawbacks:
- I need to set up a
pom.xmlfile with the 3rd party dependency. This is a somewhat roundabout way and tedious for quickly looking through the dependencies of a couple of libraries. dependency:treedownloads all dependencies, which can be slow and consume a lot of bandwidth for large dependency graphs.dependency:tree -Dverbosedoes show conflicts but it is quite verbose as it also shows all non conflicting dependencies.
The CLI of the Coursier dependency resolver can do this. E.g. to find dependency conflicts in
com.bynder:bynder-java-sdk:2.2.8you can use Coursier'sresolvecommand with the--conflictflag:This outputs a list of conflicts and nothing more. No artifacts are downloaded besides its metadata and the whole process is very quick.
To further explore where the conflict on e.g.
com.squareup.okhttp3:okhttpis coming from, you can runThe output is an inverse dependency tree showing all subtrees that depend on
com.squareup.okhttp3:okhttp.