Exclude not available in java-platform constraints?


I’ve tried to transform a currently manually written bom to a gradle java-platform plugin project. Now I see a error when trying to add exclusions to those contraints:

        api ("org.apache.cactus:cactus.core.framework.uberjar.javaEE.15:1.8.1") {
            exclude group: "*", module: "*"

> Could not find method exclude() for arguments [{group=*, module=*}] on constraint org.apache.cactus:cactus.core.framework.uberjar.javaEE.15:1.8.1, attributes=null of type org.gradle.api.internal.artifacts.dependencies.DefaultDependencyConstraint.

the described jar is a ueber jar, in fact it should not have any dependencies, but still the meta-data is as it is and lists all included dependencies.
In our hand written BOM we could describe the exclusions and no consuming build had to care about them. Is this possible or a planned feature for java-platforms?

kind regards

Did you ever find a resolution? I have the same issue.

You could do

api ("org.apache.cactus:cactus.core.framework.uberjar.javaEE.15:1.8.1") {
   transitive = false

No, that is not possible for DependencyConstraints.

Acually it all works as desired if you publish a hand written BOM with individual excludes, but the java-platform-plugin has no syntax to generate every kind of exclusions.
As far as I remeber excluding all dependencies worked as mentioned above, but that does not cover our usecases, so we keep writing the BOM by hand.

So what is the resolution?