From 3780bee88eb88dbf8468cfeaf44ac53681b78214 Mon Sep 17 00:00:00 2001 From: Joe Grandja Date: Tue, 18 Aug 2020 11:23:08 -0400 Subject: [PATCH] Update dependency-management.gradle --- gradle/dependency-management.gradle | 46 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/gradle/dependency-management.gradle b/gradle/dependency-management.gradle index b439da5..20f8b46 100644 --- a/gradle/dependency-management.gradle +++ b/gradle/dependency-management.gradle @@ -1,7 +1,20 @@ +if (!project.hasProperty("springVersion")) { + ext.springVersion = "5.2.+" +} + +if (!project.hasProperty("springSecurityVersion")) { + ext.springSecurityVersion = "5.4.+" +} + +if (!project.hasProperty("reactorVersion")) { + ext.reactorVersion = "Dysprosium-SR+" +} + dependencyManagement { imports { - mavenBom 'org.springframework:spring-framework-bom:latest.release' - mavenBom 'org.springframework.security:spring-security-bom:latest.release' + mavenBom "org.springframework:spring-framework-bom:$springVersion" + mavenBom "org.springframework.security:spring-security-bom:$springSecurityVersion" + mavenBom "io.projectreactor:reactor-bom:$reactorVersion" } dependencies { @@ -17,3 +30,32 @@ dependencyManagement { dependency "com.jayway.jsonpath:json-path:2.+" } } + +/* +NOTE: +The latest `reactor-netty` dependency was split into `reactor-netty-core` and `reactor-netty-http`, +which resulted in the snapshot build to fail. The below configuration fixes it. + +Reference: +- https://github.com/spring-projects/spring-security/issues/8909 +- https://github.com/reactor/reactor-netty/issues/739#issuecomment-667047117 +*/ +if (reactorVersion.startsWith('20')) { + if (reactorVersion.endsWith('SNAPSHOT') || reactorVersion.endsWith('+')) { + ext.reactorLatestVersion = "latest.integration" + } else { + ext.reactorLatestVersion = "latest.release" + } + configurations { + all { + resolutionStrategy { + eachDependency { DependencyResolveDetails details -> + if (details.requested.name == 'reactor-netty') { + details.useTarget("${details.requested.group}:reactor-netty-http:${reactorLatestVersion}") + details.because("reactor-netty is now split into reactor-netty-core and reactor-netty-http") + } + } + } + } + } +}