This message was deleted.
# community-support
s
This message was deleted.
j
afaik there is no way to exclude dependencies or constraints in the publication API. What you can do is define constraints in a separate configuration that you only use for the
*Classpath
but not the
*Elements
E.g.:
Copy code
val constraint = configurations.create("constraint")
configurations.compileClasspath.get().extendsFrom(constraint)
configurations.runtimeClasspath.get().extendsFrom(constraint)
// or others/more if you have Android or KMP
And then define your alls constraints on the
constraint
configuration.
t
yeah, I've read an issue with this solution. Actually we applied constraint too broad, which adds unnecessary
<dependencyManagement>
block in publication where constraint dependency is not used. So I redo our script to apply constraint only when project has configuration with this constrained dependency.