How can I find out what's artifact is downgrading a dependency?

Gradle v3.4.1

I have the following when I run a dependency tree

+--- project :zift-core
| ....
|    +--- com.hazelcast:hazelcast:4.0.1 -> 3.6.8

I even have this in my build.gradle file

dependencies {
    compile("com.hazelcast:hazelcast:4.0.1") {
      force = true
    }
}

How can I find out what artifact is downgrading the version to 3.6.8?

Thanks

It is not an easy task. Some 3rd party API (Spring io.spring.gradle:dependency-management-plugin, native BOM file support, etc) can magically alter Gradle behavior.

Copy dependency declaration parts to a simple project and start to eliminate dependencies and plugins until you find an offender ))

The dependencyInsight task can sometimes be helpful in answering these types of questions.

./gradle dI --configuration compileClasspath --dependency hazelcast

The dI option doesn’t work with implementation dependencies. IOW, this will not work

./gradle dI --configuration implementation --dependency someDependency

Why not? …

True, the implementation configuration is not resolvable. If you want to know why a compile dependency’s version is being downgraded, then you need to look at it from the perspective of the compileClasspath configuration in order to get the complete picture. implementation is just a container for declaring dependencies and is not the only configuration that makes up the compile classpath.

Ah, makes sense that it only works with resolvable configurations.