From 536156a4ec297e8cc316e7a907cbb7f5a87223d2 Mon Sep 17 00:00:00 2001 From: John Blum Date: Fri, 13 Jan 2017 17:54:44 -0800 Subject: [PATCH] Consistentely apply Spring Data BOM across Spring Session modules Fixes gh-709 --- build.gradle | 20 ++++++++++++--- docs/src/docs/asciidoc/guides/mongo.adoc | 3 +-- gradle.properties | 1 - samples/boot/build.gradle | 9 ++++--- samples/findbyusername/build.gradle | 7 +++--- samples/httpsession-gemfire-boot/build.gradle | 20 ++++++++------- .../build.gradle | 12 +++++---- .../build.gradle | 12 +++++---- samples/mongo/build.gradle | 2 +- spring-session-data-gemfire/build.gradle | 16 ++++++------ spring-session-data-mongo/build.gradle | 10 ++++---- spring-session-data-redis/build.gradle | 16 ++++++------ spring-session/build.gradle | 25 ++++++++----------- 13 files changed, 84 insertions(+), 69 deletions(-) diff --git a/build.gradle b/build.gradle index 6471d4ec..cbaaf45a 100644 --- a/build.gradle +++ b/build.gradle @@ -15,15 +15,12 @@ buildscript { plugins { id "org.sonarqube" version "2.1" + id "io.spring.dependency-management" version "1.0.0.RC2" } group = 'org.springframework.session' ext.springBootVersion = '2.0.0.BUILD-SNAPSHOT' -ext.springDataGemFireVersion = "${springDataVersion}" -ext.springDataMongoVersion = "${springDataVersion}" -ext.springDataRedisVersion = "${springDataVersion}" - ext.IDE_GRADLE = "$rootDir/gradle/ide.gradle" ext.JAVA_GRADLE = "$rootDir/gradle/java.gradle" ext.SPRING3_GRADLE = "$rootDir/gradle/spring3.gradle" @@ -39,7 +36,22 @@ ext.snapshotBuild = version.endsWith('SNAPSHOT') ext.milestoneBuild = !(releaseBuild || snapshotBuild) apply plugin: 'base' +apply from: JAVA_GRADLE +dependencyManagement { + imports { + mavenBom "org.springframework.data:spring-data-releasetrain:$springDataReleaseTrainVersion" + } +} + +def managedVersions = dependencyManagement.managedVersions + +//println "ManagedVersions Count: " + managedVersions.size() +//managedVersions.each { entry -> println entry } + +ext.springDataGemFireVersion = managedVersions['org.springframework.data:spring-data-gemfire'] +ext.springDataMongoDBVersion = managedVersions['org.springframework.data:spring-data-mongodb'] +ext.springDataRedisVersion = managedVersions['org.springframework.data:spring-data-redis'] sonarqube { properties { diff --git a/docs/src/docs/asciidoc/guides/mongo.adoc b/docs/src/docs/asciidoc/guides/mongo.adoc index 1c1636d6..dd2461b9 100644 --- a/docs/src/docs/asciidoc/guides/mongo.adoc +++ b/docs/src/docs/asciidoc/guides/mongo.adoc @@ -20,9 +20,8 @@ If you are using Maven, ensure to add the following dependencies: org.springframework.session - spring-session-data-mongo + spring-session {spring-session-version} - pom org.springframework.boot diff --git a/gradle.properties b/gradle.properties index da0c1368..a5999a7d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,7 +18,6 @@ reactorVersion=3.0.3.RELEASE seleniumVersion=2.52.0 servletApiVersion=3.0.1 springVersion=5.0.0.BUILD-SNAPSHOT -springDataVersion=2.0.0.BUILD-SNAPSHOT springDataReleaseTrainVersion=Kay-BUILD-SNAPSHOT springSecurityVersion=4.2.2.BUILD-SNAPSHOT springShellVersion=1.1.0.RELEASE diff --git a/samples/boot/build.gradle b/samples/boot/build.gradle index 445e1ac6..b1994c9e 100644 --- a/samples/boot/build.gradle +++ b/samples/boot/build.gradle @@ -15,12 +15,13 @@ apply from: SAMPLE_GRADLE group = 'samples' +ext['spring-data-releasetrain.version'] = springDataReleaseTrainVersion + dependencies { - compile project(':spring-session'), - "org.springframework.boot:spring-boot-starter-data-redis", - "org.springframework.boot:spring-boot-starter-web", - "org.springframework.boot:spring-boot-starter-thymeleaf", + compile project(':spring-session-data-redis'), "org.springframework.boot:spring-boot-starter-security", + "org.springframework.boot:spring-boot-starter-thymeleaf", + "org.springframework.boot:spring-boot-starter-web", "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect", "org.thymeleaf.extras:thymeleaf-extras-conditionalcomments", "org.webjars:bootstrap:$bootstrapVersion", diff --git a/samples/findbyusername/build.gradle b/samples/findbyusername/build.gradle index ccafb4eb..9f979cad 100644 --- a/samples/findbyusername/build.gradle +++ b/samples/findbyusername/build.gradle @@ -15,12 +15,13 @@ apply from: SAMPLE_GRADLE group = 'samples' +ext['spring-data-releasetrain.version'] = springDataReleaseTrainVersion + dependencies { - compile project(':spring-session'), - "org.springframework.boot:spring-boot-starter-data-redis", - "org.springframework.boot:spring-boot-starter-web", + compile project(':spring-session-data-redis'), "org.springframework.boot:spring-boot-starter-security", "org.springframework.boot:spring-boot-starter-thymeleaf", + "org.springframework.boot:spring-boot-starter-web", "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect", "org.thymeleaf.extras:thymeleaf-extras-conditionalcomments", "org.webjars:bootstrap:$bootstrapVersion", diff --git a/samples/httpsession-gemfire-boot/build.gradle b/samples/httpsession-gemfire-boot/build.gradle index 863d657b..1c989a93 100644 --- a/samples/httpsession-gemfire-boot/build.gradle +++ b/samples/httpsession-gemfire-boot/build.gradle @@ -9,14 +9,14 @@ buildscript { } apply from: JAVA_GRADLE +apply from: SAMPLE_GRADLE apply plugin: "application" apply plugin: 'org.springframework.boot' -apply from: SAMPLE_GRADLE + +ext['spring-data-releasetrain.version'] = springDataReleaseTrainVersion dependencies { - compile "org.springframework.data:spring-data-gemfire:$springDataGemFireVersion", - project(":spring-session"), - // project(':spring-session-data-gemfire'), + compile project(':spring-session-data-gemfire'), "org.springframework.boot:spring-boot-starter-thymeleaf", "org.springframework.boot:spring-boot-starter-web", "org.webjars:bootstrap:$bootstrapVersion", @@ -49,11 +49,13 @@ task runGemFireServer() { String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator) - String[] commandLine = ['java', '-server', '-ea', '-classpath', classpath, - "-Dgemfire.cache.server.port=$port", - //"-Dgemfire.log-file=gemfire-server.log", - "-Dgemfire.log-level=" + System.getProperty('gemfire.log.level', 'config'), - 'sample.server.GemFireServer'] + String[] commandLine = [ + 'java', '-server', '-ea', '-classpath', classpath, + "-Dgemfire.cache.server.port=$port", + //"-Dgemfire.log-file=gemfire-server.log", + "-Dgemfire.log-level=" + System.getProperty('gemfire.log.level', 'config'), + 'sample.server.GemFireServer' + ] //println commandLine diff --git a/samples/httpsession-gemfire-clientserver-xml/build.gradle b/samples/httpsession-gemfire-clientserver-xml/build.gradle index a0725087..ad560249 100644 --- a/samples/httpsession-gemfire-clientserver-xml/build.gradle +++ b/samples/httpsession-gemfire-clientserver-xml/build.gradle @@ -40,12 +40,14 @@ task runGemFireServer(dependsOn: availablePort) { println 'STARTING GEMFIRE SERVER...' String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator) + String gemfireLogLevel = System.getProperty('sample.httpsession.gemfire.log-level', 'warning') - String[] commandLine = ['java', '-server', '-ea', - "-Dspring.session.data.gemfire.port=$port", - "-Dsample.httpsession.gemfire.log-level=" - + System.getProperty('sample.httpsession.gemfire.log-level', 'warning'), - '-classpath', classpath, 'sample.Application'] + String[] commandLine = [ + 'java', '-server', '-ea', '-classpath', classpath, + "-Dspring.session.data.gemfire.port=$port", + "-Dsample.httpsession.gemfire.log-level=" + gemfireLogLevel, + 'sample.Application' + ] //println commandLine diff --git a/samples/httpsession-gemfire-clientserver/build.gradle b/samples/httpsession-gemfire-clientserver/build.gradle index 9a265b2a..fdb83e93 100644 --- a/samples/httpsession-gemfire-clientserver/build.gradle +++ b/samples/httpsession-gemfire-clientserver/build.gradle @@ -41,12 +41,14 @@ task runGemFireServer(dependsOn: availablePort) { println 'STARTING GEMFIRE SERVER...' String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator) + String gemfireLogLevel = System.getProperty('sample.httpsession.gemfire.log-level', 'warning') - String[] commandLine = ['java', '-server', '-ea', - "-Dspring.session.data.gemfire.port=$port", - "-Dsample.httpsession.gemfire.log-level=" - + System.getProperty('sample.httpsession.gemfire.log-level', 'warning'), - '-classpath', classpath, 'sample.ServerConfig'] + String[] commandLine = [ + 'java', '-server', '-ea', '-classpath', classpath, + "-Dspring.session.data.gemfire.port=$port", + "-Dsample.httpsession.gemfire.log-level=" + gemfireLogLevel, + 'sample.ServerConfig' + ] //println commandLine diff --git a/samples/mongo/build.gradle b/samples/mongo/build.gradle index e40b3bd9..d978f919 100644 --- a/samples/mongo/build.gradle +++ b/samples/mongo/build.gradle @@ -17,7 +17,7 @@ group = 'samples' dependencies { compile project(':spring-session'), - "org.springframework.data:spring-data-mongodb:$springDataMongoVersion", + "org.springframework.data:spring-data-mongodb:$springDataMongoDBVersion", "org.springframework.boot:spring-boot-starter-web", "org.springframework.boot:spring-boot-starter-security", "org.springframework.boot:spring-boot-starter-thymeleaf", diff --git a/spring-session-data-gemfire/build.gradle b/spring-session-data-gemfire/build.gradle index 5c547e31..74cbc4fc 100644 --- a/spring-session-data-gemfire/build.gradle +++ b/spring-session-data-gemfire/build.gradle @@ -5,14 +5,6 @@ apply plugin: 'spring-io' description = "Aggregator for Spring Session and Spring Data GemFire" -dependencies { - compile project(':spring-session') - compile("org.springframework.data:spring-data-gemfire:$springDataGemFireVersion") { - exclude group: "org.slf4j", module: 'slf4j-api' - exclude group: "org.slf4j", module: 'jcl-over-slf4j' - } -} - dependencyManagement { springIoTestRuntime { imports { @@ -20,3 +12,11 @@ dependencyManagement { } } } + +dependencies { + compile project(':spring-session') + compile("org.springframework.data:spring-data-gemfire:$springDataGemFireVersion") { + exclude group: "org.slf4j", module: 'slf4j-api' + exclude group: "org.slf4j", module: 'jcl-over-slf4j' + } +} diff --git a/spring-session-data-mongo/build.gradle b/spring-session-data-mongo/build.gradle index f8dcb283..cb72c255 100644 --- a/spring-session-data-mongo/build.gradle +++ b/spring-session-data-mongo/build.gradle @@ -6,11 +6,6 @@ apply plugin: 'spring-io' description = "Aggregator for Spring Session and Spring Data Mongo" -dependencies { - compile project(':spring-session'), - "org.springframework.data:spring-data-mongodb:$springDataMongoVersion" -} - dependencyManagement { springIoTestRuntime { imports { @@ -18,3 +13,8 @@ dependencyManagement { } } } + +dependencies { + compile project(':spring-session'), + "org.springframework.data:spring-data-mongodb:$springDataMongoDBVersion" +} diff --git a/spring-session-data-redis/build.gradle b/spring-session-data-redis/build.gradle index f32a74db..8fdd61d0 100644 --- a/spring-session-data-redis/build.gradle +++ b/spring-session-data-redis/build.gradle @@ -6,6 +6,14 @@ apply plugin: 'spring-io' description = "Aggregator for Spring Session and Spring Data Redis" +dependencyManagement { + springIoTestRuntime { + imports { + mavenBom "io.spring.platform:platform-bom:${springIoVersion}" + } + } +} + dependencies { compile project(':spring-session') compile ("org.springframework.data:spring-data-redis:$springDataRedisVersion") { @@ -15,11 +23,3 @@ dependencies { compile "redis.clients:jedis:$jedisVersion", "org.apache.commons:commons-pool2:$commonsPoolVersion" } - -dependencyManagement { - springIoTestRuntime { - imports { - mavenBom "io.spring.platform:platform-bom:${springIoVersion}" - } - } -} diff --git a/spring-session/build.gradle b/spring-session/build.gradle index 98af6d3a..e9b431e7 100644 --- a/spring-session/build.gradle +++ b/spring-session/build.gradle @@ -14,6 +14,14 @@ configurations { jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo } +dependencyManagement { + springIoTestRuntime { + imports { + mavenBom "io.spring.platform:platform-bom:${springIoVersion}" + } + } +} + dependencies { compile "commons-logging:commons-logging:$commonsLoggingVersion" @@ -22,9 +30,9 @@ dependencies { "org.springframework:spring-messaging:$springVersion", "org.springframework:spring-web:$springVersion", "org.springframework:spring-websocket:$springVersion", - "org.springframework.data:spring-data-gemfire", - "org.springframework.data:spring-data-mongodb", - "org.springframework.data:spring-data-redis", + "org.springframework.data:spring-data-gemfire:$springDataGemFireVersion", + "org.springframework.data:spring-data-mongodb:$springDataMongoDBVersion", + "org.springframework.data:spring-data-redis:$springDataRedisVersion", "org.springframework.security:spring-security-core:$springSecurityVersion", "org.springframework.security:spring-security-web:$springSecurityVersion", "com.hazelcast:hazelcast:$hazelcastVersion" @@ -52,17 +60,6 @@ dependencies { } -dependencyManagement { - imports { - mavenBom "org.springframework.data:spring-data-releasetrain:$springDataReleaseTrainVersion" - } - springIoTestRuntime { - imports { - mavenBom "io.spring.platform:platform-bom:${springIoVersion}" - } - } -} - ext.javadocLinks = [ "http://docs.oracle.com/javase/8/docs/api/", "http://docs.oracle.com/javaee/7/api/",