# Pom dependency excludes wildcard excluding the dependency itself

**URL:** <https://discuss.gradle.org/t/pom-dependency-excludes-wildcard-excluding-the-dependency-itself/1316>\
**Category:** Old Forum Archive\
**Created:** [February 17, 2015, 2:30am UTC](https://discuss.gradle.org/t/pom-dependency-excludes-wildcard-excluding-the-dependency-itself/1316 "2015-02-17T02:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakewharton](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jakewharton/32/103_2.png) [@jakewharton](https://discuss.gradle.org/u/jakewharton)\
**Post date:** [February 17, 2015, 2:30am UTC](https://discuss.gradle.org/t/pom-dependency-excludes-wildcard-excluding-the-dependency-itself/1316/1 "2015-02-17T02:30:00Z")

</div>

In Gradle 2.3 the parsing of an artifact dependency’s excludes (from a pom) changed such that a wildcard appears to be excluding the dependency itself (and not just its transitive dependencies).

An example of this can be seen with Robolectric 2.4 which depends on the maven-ant-tasks artifact. It declares a wildcard excludes ([https://github.com/robolectric/robolectric/blob/robolectric-2.4/robolectric/pom.xml#L171-L183](https://github.com/robolectric/robolectric/blob/robolectric-2.4/robolectric/pom.xml#L171-L183)) on this dependency to not pull any of its transitive dependencies. When declaring this as a testCompile dependency, Gradle 2.2.1 correctly pulls the maven-ant-tasks.jar but none of its transitive dependencies. Starting with Gradle 2.3, the maven-ant-tasks.jar is missing from the classpath.

For now a workaround is to specify the maven-ant-tasks testCompile manually with transitive=false.

---

<div class="post-metadata">

**Author:** ![bmuschko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/bmuschko/32/5458_2.png) [@bmuschko](https://discuss.gradle.org/u/bmuschko)\
**Post date:** [February 17, 2015, 1:16pm UTC](https://discuss.gradle.org/t/pom-dependency-excludes-wildcard-excluding-the-dependency-itself/1316/2 "2015-02-17T13:16:00Z")

</div>

Thanks for reporting. I created an issue for it: GRADLE-3243.
