Hi,
I have a multi module project where i have centralized some dependencies in a dependencies.gradle file that is applied in the settings.gradle (apply from: './dependencies.gradle'
)
I want to be able to use BOM files to determine dependency versions so that instead of doing
dependencyResolutionManagement {
versionCatalogs {
testLibs {
def junitVersion = '5.12.0'
library('junitJupiter', "org.junit.jupiter:junit-jupiter:$junitVersion")
library('junitJupiterEngine', "org.junit.jupiter:junit-jupiter-engine:$junitVersion")
library('junitJupiterApi', "org.junit.jupiter:junit-jupiter-api:$junitVersion")
}
}
}
I want to use the bom file so i dont need to specify the version for the individual artifacts i.e something like this:
dependencyResolutionManagement {
versionCatalogs {
testLibs {
library('junitBom', platform("org.junit:junit-bom:5.12.0"))
library('junitJupiter', "org.junit.jupiter:junit-jupiter")
library('junitJupiterEngine', "org.junit.jupiter:junit-jupiter-engine")
library('junitJupiterApi', "org.junit.jupiter:junit-jupiter-api")
}
}
}
However platform cannot be used in this context:
Could not find method platform() for arguments [org.junit:junit-bom:5.12.0] on object of type org.gradle.api.internal.catalog.DefaultVersionCatalogBuilder.
Is there are way to do this?