Can I refer version catalog in settings? assume i...
# community-support
k
Can I refer version catalog in settings? assume i have
gradle/libs.versions.toml
with:
Copy code
[versions]
micronaut = "4.2.0"
can i then refer to this in
settings.gradle.kts
like:
Copy code
dependencyResolutionManagement {
    versionCatalogs {
        create("mn") {
            from("io.micronaut.platform:micronaut-platform:${libs.versions.micronaut}")
        }
    }
}
I would have single source for all versions and catalogs used within projects, to easily handle pulling of those and have automated version management (renovate). I could potentially write convention settings plugin but this only moves problem to another layer.
v
No, version catalogs are defined when executing the settings script, so you cannot use them during settings script execution.
p
Why do you need to store the version in libs? Just put them in the code, renovatebot/dependabot is able to update the syntax too.