Strange problem of Gradle compare with Maven

Here’s a solution that should work. I just wrote a plugin that uses Aether to resolve transitive dependencies instead of Gradle. Once resolved in Aether, the dependencies are added to a configuration in the gradle model with transitive=false

  1. Checkout the code from https://github.com/uklance/gradle-aether
  2. cd into the gradle-aether-sample directory
  3. run gradle dependencies --configuration compile
  4. Notice io.undertow:undertow-servlet:1.4.11.Final in the dependency list

Usage

apply plugin: com.lazan.gradle.aether.GradleAetherPlugin

aether {
	repositories {
		mavenCentral()
	}
	dependencies {
		compile 'org.wildfly.swarm:undertow:2017.5.0'
	}
}

Feel free to clone & tweak the plugin… pull requests welcomed

I still can’t get your plugin working with “io.spring.dependency-management”. I wrote a new plugin for it only to retrieve the module version from aether. And it doesn’t resolve the dependencies but only collect. And it’s much faster than your method. It will solve transitive dependencies only.


Here’s the plugin that I wrote. Without the need to define any extension. Just apply it. And it will use Aether to resolve transitive dependencies instead of Gradle.
No need to modify anything. And it’s working with “io.spring.dependency-management”.