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