Pom dependency excludes wildcard excluding the dependency itself

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) 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.

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