From bc495a5c899559b7e4452dcd2ec49c4856bdbbc7 Mon Sep 17 00:00:00 2001 From: Sergei Egorov Date: Tue, 10 Jul 2018 22:41:13 +0200 Subject: [PATCH] Generate "exclusions" in POM (#772) --- gradle/publishing.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gradle/publishing.gradle b/gradle/publishing.gradle index aecb64b0aa2..14c385144ba 100644 --- a/gradle/publishing.gradle +++ b/gradle/publishing.gradle @@ -58,6 +58,16 @@ publishing { appendNode('artifactId', dependency.name) appendNode('version', dependency.version) appendNode('scope', scope) + + if (dependency instanceof ModuleDependency && !dependency.excludeRules.empty) { + def excludesNode = appendNode('exclusions') + for (rule in dependency.excludeRules) { + excludesNode.appendNode('exclusion').with { + appendNode('groupId', rule.group) + appendNode('artifactId', rule.module) + } + } + } } }