Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace dependency management plugin with Gradle platform dependencies #298

Merged
merged 1 commit into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand All @@ -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"
Expand All @@ -63,7 +54,6 @@ configure(allprojects) {
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "io.spring.dependency-management"

repositories {
mavenCentral()
Expand All @@ -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" }
}
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions publish-maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
11 changes: 4 additions & 7 deletions spring-cloud-open-service-broker-autoconfigure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions spring-cloud-open-service-broker-contract-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why use the dm plugin here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spring Cloud Contract seems to have some dependency on the DM plugin. When I tried to use the platform dependency, the submodule would not build. Considering this is only for tests and we aren't publishing this module, I decided to leave it alone.

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"

Expand Down
13 changes: 5 additions & 8 deletions spring-cloud-open-service-broker-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 3 additions & 6 deletions spring-cloud-open-service-broker-docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 1 addition & 6 deletions spring-cloud-starter-open-service-broker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}

Expand Down