This message was deleted.
# dependency-management
s
This message was deleted.
j
Oh this really is a missing feature it looks like. 😞 You could use Ivy publications instead I guess. If you only use Gradle (and with that the Gradle Metadata) it effectively makes no difference if you use Ivy or Maven… Maybe you know this already, but you can write a component metadata rule to infer the
status
attribute from the version at resolution time. E.g. a rule like that:
Copy code
@CacheableRule
abstract class ComponentStatusRule : ComponentMetadataRule {
    override fun execute(context: ComponentMetadataContext) {
        val version = context.details.id.version
        val lcVersion = version.toLowerCase()
        if (lcVersion.contains("alpha")
            || lcVersion.contains("-b")
            || lcVersion.contains("beta")
            || lcVersion.contains("cr")
            || lcVersion.contains("m")
            || lcVersion.contains("rc")) {

            context.details.status = "integration"
        }
    }
}
Copy code
dependencies.components {
    all<ComponentStatusRule>()
}
Of course all the projects in your organisation then needs to use this rule….. On the upside you also get the “right” status for the external libraries that are published on Maven Central.
p
interesting, thank you @Jendrik Johannes - will play around with that a bit
j
Here are the related docs: https://docs.gradle.org/current/userguide/component_metadata_rules.html#sec:custom_status_scheme (Although it does not give the example with the version number, which is probably the most useful application of such a rule)
🙏 1