I have a platform that defines the spring boot version to use
plugins {
`java-platform`
}
javaPlatform {
allowDependencies()
}
group = "com.example.platform"
version = "1.0.0"
val springBootVersion="2.4.1"
dependencies {
api(platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion"))
api(platform("org.testcontainers:testcontainers-bom:1.15.1"))
constraints {
api("com.google.guava:guava:30.1-jre")
// testing dependencies
api("com.icegreen:greenmail:1.6.1")
api("nl.jqno.equalsverifier:equalsverifier:3.5")
api("org.threeten:threeten-extra:1.5.0")
// boot gradle plugin
api("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
When I use the above paltform in a Spring Boot project I still have to set the version number like what you see below 2.4.1 has to be set explicitly. Is there a way in the settings.gradle.kts to indicate the version numbers of all plugins used from the values in the platform?
plugins {
id("org.springframework.boot") version "2.4.1"
`java-library`
}
dependencies {
developmentOnly(platform("com.examples.platforms:primary:1.0.0" ))
developmentOnly("org.springframework.boot:spring-boot-devtools")
implementation(platform("com.example.platforms:primary:1.0.0" ))
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("org.springframework.boot:spring-boot-starter-validation")
testImplementation(platform("com.example.platforms:primary:1.0.0" ))
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("nl.jqno.equalsverifier:equalsverifier")
}