# New ivy-publishing plugin does not take into account global dependency exclusions

**URL:** <https://discuss.gradle.org/t/new-ivy-publishing-plugin-does-not-take-into-account-global-dependency-exclusions/19345>\
**Category:** Bugs\
**Tags:** not-a-bug\
**Created:** [September 2, 2016, 12:44pm UTC](https://discuss.gradle.org/t/new-ivy-publishing-plugin-does-not-take-into-account-global-dependency-exclusions/19345 "2016-09-02T12:44:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jotel](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jotel/32/5513_2.png) [@jotel](https://discuss.gradle.org/u/jotel)\
**Post date:** [September 2, 2016, 12:44pm UTC](https://discuss.gradle.org/t/new-ivy-publishing-plugin-does-not-take-into-account-global-dependency-exclusions/19345/1 "2016-09-02T12:44:37Z")

</div>

When using global (per configuration) exclusion of certain dependencies, this is not reflected in produced ivy.xml descriptior file. The legacy method using uploadArchives task does this part correctly. Bellow is a sample project showing the problem

```gradle
group = 'test'
version = '1.0'

apply plugin: 'java'
apply plugin: 'ivy-publish'

repositories {
    jcenter()
}

publishing {
  publications {
    ivy(IvyPublication) {
      from components.java
    }
  }
  repositories {
    ivy {
      url "file://${buildDir}/repo"
    }
  }
}

configurations.all {
  exclude group: 'commons-logging', module: 'commons-logging'
}

dependencies {
  compile "org.springframework:spring-core:4.2.6.RELEASE"
}

```

It’s expected for the above file to produce ivy.xml with the following entry for every configuration published in section.

```gradle
<exclude org="commons-logging" module="commons-logging" artifact="*" type="*" ext="*" conf="<CONFNAME>" matcher="exact"/>

```

where will be replaced with a proper conf. name

Gradle Version: 3.0  
Operating System and JVM version: OSX 10.11.6, JVM v,1.8.0\_65-b17  
Is this a regression? no, it looks like it never workded, tested on gradle 2.9 with the same result

Sample project: [https://github.com/jotel/gradle-ivy-publish-issue](https://github.com/jotel/gradle-ivy-publish-issue)

---

<div class="post-metadata">

**Author:** ![Stefan\_Wolf](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/stefan_wolf/32/5519_2.png) [@Stefan\_Wolf](https://discuss.gradle.org/u/Stefan_Wolf)\
**Post date:** [September 5, 2016, 2:42pm UTC](https://discuss.gradle.org/t/new-ivy-publishing-plugin-does-not-take-into-account-global-dependency-exclusions/19345/2 "2016-09-05T14:42:42Z")

</div>

Hi Jared,

even local exclusions have not been included in the generated ivy xml. Gradle `3.1` will have a fix for that. See also [GRADLE-3440](https://issues.gradle.org/browse/GRADLE-3440). Could you check if your problem is fixed with the latest Gradle [nightly](https://gradle.org/gradle-nightly-build/).

Cheers,  
Stefan

---

<div class="post-metadata">

**Author:** ![jotel](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jotel/32/5513_2.png) [@jotel](https://discuss.gradle.org/u/jotel)\
**Post date:** [September 5, 2016, 9:27pm UTC](https://discuss.gradle.org/t/new-ivy-publishing-plugin-does-not-take-into-account-global-dependency-exclusions/19345/3 "2016-09-05T21:27:08Z")

</div>

Hi Stefan,

the [GRADLE-3440](https://issues.gradle.org/browse/GRADLE-3440) refers to uploadArchives task which uses different method… the problem I’ve described is for new (well… it’s how it is referred in documentation anyway 😉[ivy-publishing](https://docs.gradle.org/current/userguide/publishing_ivy.html) plugin which uses a [PublishingExtension](https://docs.gradle.org/current/dsl/org.gradle.api.publish.PublishingExtension.html)… The problem still exists in the latest Gradle nightly build. There is no problem though with exclusion at the particular dependency level e.g.

```gradle
dependencies {
  compile "org.springframework:spring-core:4.2.6.RELEASE", {
    exclude group: 'commons-logging'
  }
}

```

which works from version 2.14 of Gradle.

Regards  
Jarek

---

<div class="post-metadata">

**Author:** ![Stefan\_Wolf](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/stefan_wolf/32/5519_2.png) [@Stefan\_Wolf](https://discuss.gradle.org/u/Stefan_Wolf)\
**Post date:** [September 6, 2016, 1:14pm UTC](https://discuss.gradle.org/t/new-ivy-publishing-plugin-does-not-take-into-account-global-dependency-exclusions/19345/4 "2016-09-06T13:14:39Z")

</div>

Hi Jarek,

you are completely right. We will probably not start working on this feature soon. We would be happy if you could provide a pull request, though.

Regards,  
Stefan
