Sid B
07/08/2024, 3:45 PMVampire
07/08/2024, 4:10 PMenforcedPlatform is buggy. enforcedPlatform should not be used in most cases but is only a biiig-hammer last solution and should never be used in anything published. You even have to enforce that Gradle publishes such a metadata as it fails if you try to by default.Niels Doucet
07/09/2024, 8:45 AMVampire
07/09/2024, 9:17 AMdependencies {
components {
withModule("misbehaving:dependency") {
allVariants {
withDependencies {
forEach {
if ((it.group == "group-of-platform") && (it.name == "name-of-platform")) {
it.version {
require(requiredVersion)
}
it.attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.REGULAR_PLATFORM))
}
}
}
}
}
}
}
}
This downgrades the strict version for the platform to a required version (for example if version alignment is used properly like for log4j,
and downgrades the platform content from enforced to regular platform.