I have a dependency which has changed GAV and I'd ...
# community-support
g
I have a dependency which has changed GAV and I'd like to express a
ComponentMetadataRule
to properly manage that Like here
Copy code
dependencies {
    // Activate the "LoggingCapability" rule
    components.all(LoggingCapability::class.java)
}

class LoggingCapability : ComponentMetadataRule
if I do this directly in a platform, would this be applied as I expect on the consumers applying that platform or shall this rule be defined and activated on the consumers (either directly or with a plugin)?
t
Platforms only express dependency constraints. Metadata rules or other resolution rules need to be added to each project.
I think you could add a
rejectAll()
constraint on the old GAV in your platform to make sure there are appropriate rules in the consuming projects (if you haven't already added capabilities to your dependency to trigger a resolution error) edit: ha, should have clicked the link before adding that comment, you probably already have a capability that triggers an error if you want to add a capability rule to handle such conflicts 😉
g
Platforms only express dependency constraints. Metadata rules or other resolution rules need to be added to each project.
as I imagined, thanks for clearing that
ps: could it be also a Gradle plugin, am I right?
t
A Gradle plugin is just the packaging/automation of something you could write in your build script (and conversely, anything you can write in a build script can be packaged into a plugin), so yes.
👍 1