Dependencies not using sub-dependencies like Maven

I’m converting a maven build to Gradle.

In my maven project (in eclipse) I have a dependency…


If I look at the dependency tree it shows that maven loads its dependency …


However, Gradle does not load this dependency and I am forced to add a compileOnly line in my dependencies like this…

compileOnly ‘org.codehaus.groovy:groovy-cli-commons:’ + groovy_version
compileOnly ‘commons-cli:commons-cli:1.4’ // Why is this needed when it is a dependency of groovy-cli-commons ?

What I’m I missing?

If I look at the dependency here

I can see that commons-cli is a runtime dependency, not a compile dependency

Yes, I now see that, but is this just a difference in the way Maven handles “provided” dependencies vs Gradle “compileOnly” dependencies? I was assuming that “provided” was the same as “compileOnly”. Maybe I’m mistaken. Seems like Maven is more “forgiving”… which I will admit is not following what the dependency rules are…

I don’t claim to be an expert in the differences of maven provided vs gradle compileOnly, possibly worth reading