Hello everyone,
In our project, we have a Gradle plugin wrapping and applying the Spring Boot one, homogenizing the SB configuration across the different projects. This plugin uses a special versioning that follows the SB version, but also adding its own patch version. For instance for SB 2.3.1.RELEASE, our plugin's version will be 2.3.1-0. This plugin applies at the moment the DependencyManagement
plugin as well.
What we would like to do now is to migrate to Gradle's platform in order to import the SB BOM. To ease future SB upgrades, we would like to have a property referencing the currently applied SB version. For instance:
plugins {
...
id 'com.own.plugin.boot' version '2.3.1-0'
...
}
dependencies {
...
implementation(platform('org.springframework.boot:spring-boot-dependencies:${spring-boot.version}'))
...
}
I also think that notwithstanding our own Gradle plugin, using Gradle's platform would be easier with a spring-boot.version
property available.
Therefore, as feature request, I would like to ask if it would be possible for the Gradle (and also Maven) plugin to export the SB version as a property when applied.
Comment From: wilkinsona
Thanks for the suggestion. The Gradle plugin provides a constant for this purpose: org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
. It can be used with a platform
dependencies as follows:
dependencies {
...
implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
...
}