From 61262739852a2095df79b1047dc3515361109f53 Mon Sep 17 00:00:00 2001 From: Roy Clarkson Date: Thu, 18 Jun 2020 17:52:22 -0400 Subject: [PATCH] Replace dependency management plugin with Gradle platform dependencies --- build.gradle | 17 ++--------------- publish-maven.gradle | 7 +++++-- .../build.gradle | 1 + .../build.gradle | 1 + .../build.gradle | 11 ++++------- .../build.gradle | 2 ++ .../build.gradle | 13 +++++-------- .../build.gradle | 9 +++------ .../build.gradle | 7 +------ 9 files changed, 24 insertions(+), 44 deletions(-) diff --git a/build.gradle b/build.gradle index d933824b..f3ff2b8b 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,6 @@ buildscript { } dependencies { classpath("io.spring.nohttp:nohttp-gradle:0.0.5.RELEASE") - classpath("io.spring.gradle:dependency-management-plugin:1.0.9.RELEASE") } } @@ -41,14 +40,6 @@ ext { ] as String[] } -//override managed Spring Boot versions -if (project.hasProperty("springFrameworkVersion")) { - ext['spring-framework.version'] = ext.springFrameworkVersion -} -if (project.hasProperty("reactorVersion")) { - ext['reactor-bom.version'] = ext.reactorVersion -} - description = "Spring Cloud Open Service Broker" apply plugin: "io.spring.nohttp" @@ -63,7 +54,6 @@ configure(allprojects) { apply plugin: "java" apply plugin: "eclipse" apply plugin: "idea" - apply plugin: "io.spring.dependency-management" repositories { mavenCentral() @@ -85,8 +75,7 @@ configure(allprojects) { } } } - if (version.endsWith('SNAPSHOT') || project.hasProperty("springFrameworkVersion") || - project.hasProperty("springBootVersion")) { + if (version.endsWith('SNAPSHOT')) { repositories { maven { url "https://repo.spring.io/snapshot" } } @@ -170,9 +159,7 @@ configure(subprojects - [project(":spring-cloud-starter-open-service-broker")]) "-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", - // Suppress deprecation warnings when building against latest integration releases - (springBootVersion == "latest.integration" || springFrameworkVersion == "latest.integration") - ? "-Xlint:-deprecation" : "-Xlint:deprecation", + "-Xlint:deprecation", "-Xlint:unchecked", "-Xlint:options", "-Werror" diff --git a/publish-maven.gradle b/publish-maven.gradle index 257e41a1..fa4d4ce7 100644 --- a/publish-maven.gradle +++ b/publish-maven.gradle @@ -59,8 +59,11 @@ publishing { } } pom.withXml { - def dependencyManagementNode = asNode().get("dependencyManagement") - asNode().remove(dependencyManagementNode) + def pomNode = asNode() + def dependencyManagementNode = pomNode.get('dependencyManagement') + if (dependencyManagementNode) { + pomNode.remove(dependencyManagementNode) + } } } } diff --git a/spring-cloud-open-service-broker-acceptance-webflux/build.gradle b/spring-cloud-open-service-broker-acceptance-webflux/build.gradle index a779400a..c04945c9 100644 --- a/spring-cloud-open-service-broker-acceptance-webflux/build.gradle +++ b/spring-cloud-open-service-broker-acceptance-webflux/build.gradle @@ -28,6 +28,7 @@ configurations.archives.artifacts.clear() apply plugin: 'org.springframework.boot' dependencies { + implementation enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") implementation("org.springframework.boot:spring-boot-starter") implementation("org.springframework.boot:spring-boot-starter-webflux") implementation(project(":spring-cloud-starter-open-service-broker")) diff --git a/spring-cloud-open-service-broker-acceptance-webmvc/build.gradle b/spring-cloud-open-service-broker-acceptance-webmvc/build.gradle index c47466e0..7d0e1ffd 100644 --- a/spring-cloud-open-service-broker-acceptance-webmvc/build.gradle +++ b/spring-cloud-open-service-broker-acceptance-webmvc/build.gradle @@ -28,6 +28,7 @@ configurations.archives.artifacts.clear() apply plugin: 'org.springframework.boot' dependencies { + implementation enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") implementation("org.springframework.boot:spring-boot-starter") implementation("org.springframework.boot:spring-boot-starter-web") implementation(project(":spring-cloud-starter-open-service-broker")) diff --git a/spring-cloud-open-service-broker-autoconfigure/build.gradle b/spring-cloud-open-service-broker-autoconfigure/build.gradle index 9cc4ee35..cb293366 100644 --- a/spring-cloud-open-service-broker-autoconfigure/build.gradle +++ b/spring-cloud-open-service-broker-autoconfigure/build.gradle @@ -16,15 +16,12 @@ description = "Spring Cloud Open Service Broker Auto-Configuration" -dependencyManagement { - imports { - mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}" - } -} - dependencies { + // BOM imports - The versions used in these files will override any other versions found in the graph + implementation enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + annotationProcessor enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + api(project(":spring-cloud-open-service-broker-core")) - api("org.springframework.boot:spring-boot-starter") optionalApi("org.springframework.boot:spring-boot-starter-web") optionalApi("org.springframework.boot:spring-boot-starter-webflux") annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") diff --git a/spring-cloud-open-service-broker-contract-tests/build.gradle b/spring-cloud-open-service-broker-contract-tests/build.gradle index 8b6c1a35..7abe3bb4 100644 --- a/spring-cloud-open-service-broker-contract-tests/build.gradle +++ b/spring-cloud-open-service-broker-contract-tests/build.gradle @@ -18,12 +18,14 @@ import org.springframework.cloud.contract.verifier.config.TestFramework buildscript { dependencies { + classpath("io.spring.gradle:dependency-management-plugin:1.0.9.RELEASE") classpath("org.springframework.cloud:spring-cloud-contract-gradle-plugin:${springCloudContractVersion}") } } description = "Spring Cloud Open Service Broker Contract Tests" +apply plugin: "io.spring.dependency-management" apply plugin: "groovy" apply plugin: "spring-cloud-contract" diff --git a/spring-cloud-open-service-broker-core/build.gradle b/spring-cloud-open-service-broker-core/build.gradle index 4194f537..d97fdd4d 100644 --- a/spring-cloud-open-service-broker-core/build.gradle +++ b/spring-cloud-open-service-broker-core/build.gradle @@ -30,15 +30,12 @@ ext { javaxServletApiVersion = "3.1.0" } -dependencyManagement { - imports { - mavenBom "org.springframework:spring-framework-bom:${springFrameworkVersion}" - mavenBom "io.projectreactor:reactor-bom:${reactorVersion}" - mavenBom "com.fasterxml.jackson:jackson-bom:${jacksonVersion}" - } -} - dependencies { + // BOM imports - The versions used in these files will override any other versions found in the graph + implementation enforcedPlatform("org.springframework:spring-framework-bom:${springFrameworkVersion}") + implementation enforcedPlatform("io.projectreactor:reactor-bom:${reactorVersion}") + implementation enforcedPlatform("com.fasterxml.jackson:jackson-bom:${jacksonVersion}") + compileOnly("javax.servlet:javax.servlet-api:${javaxServletApiVersion}") api("org.springframework:spring-context") optionalApi("org.springframework:spring-web") diff --git a/spring-cloud-open-service-broker-docs/build.gradle b/spring-cloud-open-service-broker-docs/build.gradle index cea9b456..7f358e1d 100644 --- a/spring-cloud-open-service-broker-docs/build.gradle +++ b/spring-cloud-open-service-broker-docs/build.gradle @@ -27,15 +27,12 @@ configurations { docs } -dependencyManagement { - imports { - mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}" - } -} - apply plugin: 'org.asciidoctor.convert' dependencies { + // BOM imports - The versions used in these files will override any other versions found in the graph + implementation enforcedPlatform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") + implementation(project(":spring-cloud-open-service-broker-core")) implementation("org.springframework.boot:spring-boot-starter") implementation("org.springframework.boot:spring-boot-starter-security") diff --git a/spring-cloud-starter-open-service-broker/build.gradle b/spring-cloud-starter-open-service-broker/build.gradle index 5e2bc3d1..802cf7d4 100644 --- a/spring-cloud-starter-open-service-broker/build.gradle +++ b/spring-cloud-starter-open-service-broker/build.gradle @@ -16,13 +16,8 @@ description = "Spring Cloud Open Service Broker Starter" -dependencyManagement { - imports { - mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}" - } -} - dependencies { + api("org.springframework.boot:spring-boot-starter:${springBootVersion}") api(project(":spring-cloud-open-service-broker-autoconfigure")) }