From 13e02029105ca1d04d40d21637abc034d48b819d Mon Sep 17 00:00:00 2001 From: Abel Salgado Romero Date: Mon, 26 Jun 2023 16:53:54 +0200 Subject: [PATCH] (1.4.x) Remove spring boot duplication in configuration (#800) * Use SpringBootPlugin.BOM_COORDINATES to define Spring Boot dependencies version This allows removing 'springBootVersion' so that the actual version can be set only once in the boot plugin in 'settings.gradle'. This requires adding the boot plugin to all modules, modules that do not use use 'apply false' to only add the plugin libraries to the build runtime. * Replace use of enforcePlarform with platform --- build.gradle | 3 +-- settings.gradle | 10 ++++++++++ spring-cloud-app-broker-acceptance-tests/build.gradle | 6 ++++-- spring-cloud-app-broker-autoconfigure/build.gradle | 10 ++++++++-- spring-cloud-app-broker-core/build.gradle | 8 +++++++- .../build.gradle | 8 +++++++- spring-cloud-app-broker-deployer/build.gradle | 8 +++++++- spring-cloud-app-broker-docs/build.gradle | 5 ++++- spring-cloud-app-broker-integration-tests/build.gradle | 5 +++-- spring-cloud-app-broker-logging/build.gradle | 8 +++++++- spring-cloud-app-broker-security-credhub/build.gradle | 8 +++++++- 11 files changed, 65 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index db90ad5..f33ae31 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,6 @@ buildscript { immutablesVersion = "2.9.3" openServiceBrokerVersion = "3.4.2" pmdVersion = "6.29.0" - springBootVersion = "2.5.14" springCredhubVersion = "2.2.0" springFrameworkVersion = "5.3.18" wiremockVersion = "2.27.2" @@ -34,7 +33,7 @@ buildscript { } plugins { - id "io.spring.nohttp" version "0.0.11" + id 'io.spring.nohttp' id 'distribution' id 'jacoco' } diff --git a/settings.gradle b/settings.gradle index d0e7785..4558ddf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,13 @@ +pluginManagement { + plugins { + id 'io.spring.nohttp' version "0.0.11" + id 'org.springframework.boot' version "2.5.14" + } + repositories { + gradlePluginPortal() + } +} + rootProject.name = "spring-cloud-app-broker" include "spring-cloud-app-broker-deployer" diff --git a/spring-cloud-app-broker-acceptance-tests/build.gradle b/spring-cloud-app-broker-acceptance-tests/build.gradle index 6860b40..9aa68b0 100644 --- a/spring-cloud-app-broker-acceptance-tests/build.gradle +++ b/spring-cloud-app-broker-acceptance-tests/build.gradle @@ -14,14 +14,16 @@ * limitations under the License. */ +import org.springframework.boot.gradle.plugin.SpringBootPlugin + plugins { - id 'org.springframework.boot' version "2.5.14" + id 'org.springframework.boot' } description = "Spring Cloud App Broker Acceptance Tests" dependencies { - api enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + api platform(SpringBootPlugin.BOM_COORDINATES) api project(":spring-cloud-starter-app-broker-cloudfoundry") api "org.springframework.boot:spring-boot-starter-webflux" diff --git a/spring-cloud-app-broker-autoconfigure/build.gradle b/spring-cloud-app-broker-autoconfigure/build.gradle index 3fedeee..11cdee6 100644 --- a/spring-cloud-app-broker-autoconfigure/build.gradle +++ b/spring-cloud-app-broker-autoconfigure/build.gradle @@ -14,6 +14,12 @@ * limitations under the License. */ +import org.springframework.boot.gradle.plugin.SpringBootPlugin + +plugins { + id 'org.springframework.boot' apply false +} + description = "Spring Cloud App Broker Autoconfiguration" java { @@ -23,11 +29,11 @@ java { } dependencies { - annotationProcessor enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + annotationProcessor platform(SpringBootPlugin.BOM_COORDINATES) annotationProcessor "org.springframework.boot:spring-boot-configuration-processor" annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor" - api enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + api platform(SpringBootPlugin.BOM_COORDINATES) api project(":spring-cloud-app-broker-core") api project(":spring-cloud-app-broker-deployer") api project(":spring-cloud-app-broker-deployer-cloudfoundry") diff --git a/spring-cloud-app-broker-core/build.gradle b/spring-cloud-app-broker-core/build.gradle index dfb5df8..de166c8 100644 --- a/spring-cloud-app-broker-core/build.gradle +++ b/spring-cloud-app-broker-core/build.gradle @@ -14,13 +14,19 @@ * limitations under the License. */ +import org.springframework.boot.gradle.plugin.SpringBootPlugin + +plugins { + id 'org.springframework.boot' apply false +} + description = "Spring Cloud App Broker Core" dependencies { api project(":spring-cloud-app-broker-deployer") api "org.springframework.cloud:spring-cloud-open-service-broker-core:${openServiceBrokerVersion}" - api enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + api platform(SpringBootPlugin.BOM_COORDINATES) api "org.springframework:spring-core" api "org.springframework:spring-context" api "io.projectreactor:reactor-core" diff --git a/spring-cloud-app-broker-deployer-cloudfoundry/build.gradle b/spring-cloud-app-broker-deployer-cloudfoundry/build.gradle index 1d713a0..52b943f 100644 --- a/spring-cloud-app-broker-deployer-cloudfoundry/build.gradle +++ b/spring-cloud-app-broker-deployer-cloudfoundry/build.gradle @@ -14,10 +14,16 @@ * limitations under the License. */ +import org.springframework.boot.gradle.plugin.SpringBootPlugin + +plugins { + id 'org.springframework.boot' apply false +} + description = "Spring Cloud App Broker Deployer Cloud Foundry" dependencies { - api enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + api platform(SpringBootPlugin.BOM_COORDINATES) api project(":spring-cloud-app-broker-deployer") api "org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}" api "org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}" diff --git a/spring-cloud-app-broker-deployer/build.gradle b/spring-cloud-app-broker-deployer/build.gradle index 57233a2..3dc72fb 100644 --- a/spring-cloud-app-broker-deployer/build.gradle +++ b/spring-cloud-app-broker-deployer/build.gradle @@ -14,10 +14,16 @@ * limitations under the License. */ +import org.springframework.boot.gradle.plugin.SpringBootPlugin + +plugins { + id 'org.springframework.boot' apply false +} + description = "Spring Cloud App Broker Deployer" dependencies { - api enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + api platform(SpringBootPlugin.BOM_COORDINATES) api "org.springframework:spring-core" api "io.projectreactor:reactor-core" diff --git a/spring-cloud-app-broker-docs/build.gradle b/spring-cloud-app-broker-docs/build.gradle index 6cac12c..e256111 100644 --- a/spring-cloud-app-broker-docs/build.gradle +++ b/spring-cloud-app-broker-docs/build.gradle @@ -14,7 +14,10 @@ * limitations under the License. */ +import org.springframework.boot.gradle.plugin.SpringBootPlugin + plugins { + id 'org.springframework.boot' apply false id 'org.asciidoctor.jvm.pdf' version '3.3.2' id 'org.asciidoctor.jvm.convert' version '3.3.2' } @@ -26,7 +29,7 @@ configurations { } dependencies { - implementation enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + implementation platform(SpringBootPlugin.BOM_COORDINATES) implementation project(":spring-cloud-app-broker-core") implementation "org.springframework.boot:spring-boot-starter" implementation "org.springframework.boot:spring-boot-starter-data-r2dbc" diff --git a/spring-cloud-app-broker-integration-tests/build.gradle b/spring-cloud-app-broker-integration-tests/build.gradle index f28841b..d6eb4ac 100644 --- a/spring-cloud-app-broker-integration-tests/build.gradle +++ b/spring-cloud-app-broker-integration-tests/build.gradle @@ -13,15 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import org.springframework.boot.gradle.plugin.SpringBootPlugin plugins { - id 'org.springframework.boot' version "2.5.14" + id 'org.springframework.boot' } description = "Spring Cloud App Broker Integration Tests" dependencies { - implementation enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + implementation platform(SpringBootPlugin.BOM_COORDINATES) implementation project(":spring-cloud-starter-app-broker-cloudfoundry") implementation "org.springframework.boot:spring-boot-starter-webflux" diff --git a/spring-cloud-app-broker-logging/build.gradle b/spring-cloud-app-broker-logging/build.gradle index de447a6..dd59d75 100644 --- a/spring-cloud-app-broker-logging/build.gradle +++ b/spring-cloud-app-broker-logging/build.gradle @@ -14,10 +14,16 @@ * limitations under the License. */ +import org.springframework.boot.gradle.plugin.SpringBootPlugin + +plugins { + id 'org.springframework.boot' apply false +} + description = "Spring Cloud App Broker Logging" dependencies { - api enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + api platform(SpringBootPlugin.BOM_COORDINATES) api "org.springframework.boot:spring-boot-starter-webflux" api "org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}" api "org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}" diff --git a/spring-cloud-app-broker-security-credhub/build.gradle b/spring-cloud-app-broker-security-credhub/build.gradle index c84d27d..e1c070a 100644 --- a/spring-cloud-app-broker-security-credhub/build.gradle +++ b/spring-cloud-app-broker-security-credhub/build.gradle @@ -14,10 +14,16 @@ * limitations under the License. */ +import org.springframework.boot.gradle.plugin.SpringBootPlugin + +plugins { + id 'org.springframework.boot' apply false +} + description = "Spring Cloud App Broker Security CredHub" dependencies { - api enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + api platform(SpringBootPlugin.BOM_COORDINATES) api project(":spring-cloud-app-broker-core") api "org.springframework.credhub:spring-credhub-starter:${springCredhubVersion}" api "org.springframework.cloud:spring-cloud-open-service-broker-core:${openServiceBrokerVersion}"