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) + } + } + } } }