Thomas Keller
09/22/2025, 2:23 PMSettingsPlugin) to one using a central gradle/libs.versions.toml file to support GHs Renovate bot in a multi-component build. Previously I had this specific settings plugin applied to all of my sub component's settings like this:
pluginManagement {
includeBuild("../build-settings")
}
plugins {
id("my.custom.settings.plugin")
}
and it all worked fine. Now that move to that libs.versions.toml I cannot get this working any longer, since each subcomponent has it's own reference to a gradle subdir, i.e. ROOT/gradle/libs.versions.toml exists, but ROOT/subcomponent/gradle/libs.versions.toml obviously does not and if I try to manually "correct" that like this via
if (!settings.project(":").name.contains("monorepo")) {
settings.dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(
settings.layout.settingsDirectory.file("gradle/libs.versions.toml")
)
}
}
}
}
I get ROOT/subcomponent/gradle/ referenced and even if I fix that, Gradle will still tell me
java.lang.RuntimeException: org.gradle.internal.typeconversion.UnsupportedNotationException: Cannot convert the provided notation to an object of type Dependency: /local/path/to/monorepo/gradle/libs.versions.toml.
The following types/formats are supported:
- String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
- Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
- FileCollections, for example files('some.jar', 'someOther.jar').
- Projects, for example project(':some:project:path').
- ClassPathNotation, for example gradleApi().
So what am I doing wrong / how can I effectively share a TOML version catalogue in a multi-component scenario?Thomas Broyer
09/22/2025, 2:27 PMfiles() rather tha file() to get a FileCollection rather than RegularFile?Thomas Keller
09/22/2025, 2:30 PMThomas Keller
09/22/2025, 2:34 PM