if (!dep.transitive) { // If this dependency is transitive, we should force exclude all its dependencies them from the POM final exclusionNode = dependencyNode.appendNode('exclusions').appendNode ('exclusion') exclusionNode.appendNode('groupId', '*') exclusionNode.appendNode('artifactId', '*') } elseif (!dep.properties.excludeRules.empty) { // Otherwise add specified exclude rules final exclusionNode = dependencyNode.appendNode('exclusions').appendNode ('exclusion') dep.properties.excludeRules.each { ExcludeRule rule -> exclusionNode.appendNode('groupId', rule.group ?: '*') exclusionNode.appendNode('artifactId', rule.module ?: '*') } } }
// List all "compile" dependencies (for old Gradle) configurations.compile.getDependencies().each { dep -> addDependency(dep, "compile") } // List all "api" dependencies (for new Gradle) as "compile" dependencies configurations.api.getDependencies().each { dep -> addDependency(dep, "compile") } // List all "implementation" dependencies (for new Gradle) as "runtime" dependencies configurations.implementation.getDependencies().each { dep -> addDependency(dep, "runtime") } }