POM exclusions not used for dependencies

I have a dependency on a project that includes the following dependency in its POM file:

<dependency>
      <groupId>org.example</groupId>
      <artifactId>example</artifactId>
      <version>1.2.3</version>
      <scope>runtime</scope>
      <exclusions>
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

when I add this project as a dependency in my ‘build.gradle’ file I would expect ‘gradle dependencies’ to show only:

my-project -> other-project -> example:1.2.3

but instead all the transitive dependencies of ‘example:1.2.3’ are also listed. It looks as if the ‘exclusions’ tag in the POM file is simply ignored by the gradle dependency resolution.

Is there a solution to this problem? Did I misunderstand anything?

As far as I know, ‘*’ is not a valid notation for exclusions in Maven POMs. Where did you get this from?

http://maven.apache.org/pom.html#Exclusions - see second example

Thanks. I don’t think this form of exclusion is currently supported by Gradle. Raised GRADLE-3115.

Thanks! It would also be great if ‘maven-publish’ could generate such exclusions if ‘transitive’ is set to ‘false’ for certain dependencies, or at least when exclusions are explicitly specificed in the ‘gradle.build’ file.