This message was deleted.
# community-support
s
This message was deleted.
1
j
Hey. Component Metadata Rules only work on the resolving (consumer) side. Not on the publishing (producer) side. The best solution for what you want to achieve is to have a separate configuration to declare the dependency to the platform. This configuration should be part of the runtimeClasspath/compileClasspath, but not the apiElements/runtimeElements. Here is a full example: https://github.com/jjohannes/gradle-demos/tree/main/internal-platform
l
Thanks, using a configuration to host the platform is much slicker than my own approach of adding the platform dependency to each configuration as per custom plugin. Now it looks like this:
Copy code
project.configurations.all {

    if (!listOf("archives", "default", "sourcesElements", "api", "compileOnlyApi").contains(this.name)) {
        this.extendsFrom(internalPlatform)
    }