From 5eb8b25b273a9b5e0307086b553799fd012a301c Mon Sep 17 00:00:00 2001 From: Sergei Egorov Date: Sun, 8 Jul 2018 22:11:30 +0200 Subject: [PATCH] Generate "exclusions" in POM --- 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) + } + } + } } }