[GRADLE-3513] Maven plugin does not reflect dependency exclusions for group or module in generated POM Created: 27/Jul/16  Updated: 27/Jul/16  Resolved: 27/Jul/16

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 3.1-rc-1

Type: Bug
Reporter: Benjamin Muschko Assignee: Benjamin Muschko
Resolution: Fixed Votes: 0

Known Issue Of:


Given the following build script, executing gradle uploadArchives does not properly reflect the exclusions in the generated metadata. In fact the exclusions are completely omitted.

apply plugin: 'java'
apply plugin: 'maven'

group = 'org.gradle.test'
version = '1.0'

repositories {

dependencies {
    compile ('org.apache.camel:camel-jackson:2.15.3') {
        exclude group: 'org.apache.camel'
    compile ("commons-beanutils:commons-beanutils:1.8.3") {
        exclude module: 'commons-logging'

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "file://${buildDir}/repo")

This issue only occurs if the exclusion rule uses group or module. If both exclusion attribute are declare the generated metadata properly includes the exclusion.

Maven does handle this use case. I tested the following pom.xml with Maven 3.2.5.

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"

Generated at Wed Jun 30 12:50:45 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.