From 33f7ea650e145022b006f4596fa8b5877f0adc38 Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Fri, 1 Nov 2024 18:57:08 -0700 Subject: [PATCH 1/2] clean up spring dependencies --- boot-plugin/build.gradle | 2 +- build.gradle | 43 ++++++++----------- docs/build.gradle | 6 --- .../grails3-database-per-tenant/build.gradle | 3 -- gradle.properties | 1 - grails-datastore-gorm-hibernate5/build.gradle | 6 +-- grails-plugin/build.gradle | 11 ++--- 7 files changed, 27 insertions(+), 45 deletions(-) diff --git a/boot-plugin/build.gradle b/boot-plugin/build.gradle index 400c931d..9af01d7d 100644 --- a/boot-plugin/build.gradle +++ b/boot-plugin/build.gradle @@ -3,7 +3,7 @@ dependencies { exclude group:'org.apache.groovy', module:'groovy' } api "org.apache.groovy:groovy:$groovyVersion" - api "org.springframework.boot:spring-boot-autoconfigure:$springBootVersion" + api "org.springframework.boot:spring-boot-autoconfigure" api project(":grails-datastore-gorm-hibernate5") testImplementation "org.grails:grails-shell:$grailsShellVersion", { diff --git a/build.gradle b/build.gradle index e424cde0..6d7f45c9 100644 --- a/build.gradle +++ b/build.gradle @@ -99,12 +99,6 @@ subprojects { Project subproject -> if(details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) { details.useVersion(groovyVersion) } - if(details.requested.group == 'org.springframework') { - details.useVersion(springVersion) - } - if (details.requested.group == "org.springframework.boot") { - details.useVersion(springBootVersion) - } if (details.requested.group == "org.grails" && details.requested.name.contains("testing-support")) { details.useVersion(testingSupportVersion) } @@ -118,14 +112,14 @@ subprojects { Project subproject -> dependencies { implementation platform("org.grails:grails-bom:$grailsVersion") - testImplementation "jakarta.annotation:jakarta.annotation-api:$jakartaAnnotationApiVersion" + testImplementation "jakarta.annotation:jakarta.annotation-api" testImplementation "io.micrometer:micrometer-core:latest.integration" - testImplementation "io.projectreactor:reactor-test:$projectReactorVersion" - testImplementation "org.apache.groovy:groovy-test-junit5:$groovyVersion" - testImplementation("org.spockframework:spock-core:$spockVersion") { transitive = false} - testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion" - testImplementation "org.junit.platform:junit-platform-runner:$junitJupiterPlatformVersion" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion" + testImplementation "io.projectreactor:reactor-test" + testImplementation "org.apache.groovy:groovy-test-junit5" + testImplementation "org.spockframework:spock-core" + testImplementation "org.junit.jupiter:junit-jupiter-api" + testImplementation "org.junit.platform:junit-platform-runner" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" } apply from: "${rootProject.projectDir}/gradle/testVerbose.gradle" @@ -223,17 +217,18 @@ subprojects { Project subproject -> } dependencies { - documentation "org.fusesource.jansi:jansi:$jansiVersion" - documentation "org.apache.groovy:groovy-dateutil:$groovyVersion" - documentation "info.picocli:picocli:$picocliVersion" - documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion" - - implementation "org.apache.groovy:groovy:$groovyVersion" - testImplementation "org.apache.groovy:groovy-test-junit5:$groovyVersion" - testImplementation("org.spockframework:spock-core:$spockVersion") { transitive = false} - testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion" - testImplementation "org.junit.platform:junit-platform-runner:$junitJupiterPlatformVersion" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion" + documentation platform("org.grails:grails-bom:$grailsVersion") + documentation "org.fusesource.jansi:jansi" + documentation "org.apache.groovy:groovy-dateutil" + documentation "info.picocli:picocli" + documentation "com.github.javaparser:javaparser-core" + + implementation "org.apache.groovy:groovy" + testImplementation "org.apache.groovy:groovy-test-junit5" + testImplementation "org.spockframework:spock-core" + testImplementation "org.junit.jupiter:junit-jupiter-api" + testImplementation "org.junit.platform:junit-platform-runner" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" } apply from: "${rootProject.projectDir}/gradle/testVerbose.gradle" diff --git a/docs/build.gradle b/docs/build.gradle index 06517594..17e381fd 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -22,12 +22,6 @@ configurations.all { if (details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) { details.useVersion(groovyVersion) } - if (details.requested.group == 'org.springframework') { - details.useVersion(springVersion) - } - if (details.requested.group == "org.springframework.boot") { - details.useVersion(springBootVersion) - } } } diff --git a/examples/grails3-database-per-tenant/build.gradle b/examples/grails3-database-per-tenant/build.gradle index cab969cb..b671317d 100644 --- a/examples/grails3-database-per-tenant/build.gradle +++ b/examples/grails3-database-per-tenant/build.gradle @@ -2,9 +2,6 @@ group "examples" configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> - if (details.requested.group == "org.springframework.boot") { - details.useVersion(springBootVersion) - } } } diff --git a/gradle.properties b/gradle.properties index 4a1eda31..4941b71d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -32,7 +32,6 @@ snakeYamlVersion=2.3 slf4jVersion=2.0.16 spockVersion=2.3-groovy-4.0 springBootVersion=3.3.5 -springVersion=6.1.13 testingSupportVersion=4.0.0-SNAPSHOT tomcatLog4jVersion=8.5.2 tomcatVersion=10.1.31 diff --git a/grails-datastore-gorm-hibernate5/build.gradle b/grails-datastore-gorm-hibernate5/build.gradle index 62334dfc..83092bf5 100644 --- a/grails-datastore-gorm-hibernate5/build.gradle +++ b/grails-datastore-gorm-hibernate5/build.gradle @@ -2,8 +2,8 @@ dependencies { api "org.slf4j:slf4j-api:$slf4jVersion" api "org.apache.groovy:groovy:$groovyVersion" - api("org.grails:grails-datastore-gorm:$gormVersion") - api "org.springframework:spring-orm:$springVersion" + api "org.grails:grails-datastore-gorm" + api "org.springframework:spring-orm" api("org.hibernate:hibernate-core-jakarta:$hibernateVersion") { exclude group:'commons-logging', module:'commons-logging' exclude group:'com.h2database', module:'h2' @@ -46,7 +46,7 @@ dependencies { testImplementation "org.yakworks:hibernate-groovy-proxy:$hibernateGroovyProxy" testImplementation "org.apache.tomcat:tomcat-jdbc:$tomcatVersion" - testRuntimeOnly "org.springframework:spring-aop:$springVersion" + testRuntimeOnly "org.springframework:spring-aop" testRuntimeOnly "org.apache.tomcat.embed:tomcat-embed-logging-log4j:$tomcatLog4jVersion" testRuntimeOnly "org.slf4j:slf4j-simple:$slf4jVersion" diff --git a/grails-plugin/build.gradle b/grails-plugin/build.gradle index 3f391476..61dcffb4 100644 --- a/grails-plugin/build.gradle +++ b/grails-plugin/build.gradle @@ -5,9 +5,6 @@ configurations.all { details.requested.name != 'grails-datastore-gorm-hibernate5') { details.useVersion(gormVersion) } - if(details.requested.group == 'org.springframework') { - details.useVersion(springVersion) - } } } @@ -25,8 +22,8 @@ dependencies { exclude group: 'org.hamcrest', module: 'hamcrest-core' } - api "org.springframework.boot:spring-boot:$springBootVersion" - api "org.springframework:spring-orm:$springVersion" + api "org.springframework.boot:spring-boot" + api "org.springframework:spring-orm" api "org.hibernate:hibernate-core-jakarta:${hibernateVersion}" api "org.hibernate:hibernate-ehcache:$hibernateVersion" api "org.grails:grails-datastore-web:$gormVersion" @@ -46,8 +43,8 @@ dependencies { testRuntimeOnly "com.h2database:h2" testRuntimeOnly "org.apache.tomcat:tomcat-jdbc:$tomcatVersion" testRuntimeOnly "org.apache.tomcat.embed:tomcat-embed-logging-log4j:$tomcatLog4jVersion" - testRuntimeOnly "org.springframework:spring-aop:$springVersion" - testRuntimeOnly "org.springframework:spring-expression:$springVersion" + testRuntimeOnly "org.springframework:spring-aop" + testRuntimeOnly "org.springframework:spring-expression" } groovydoc.classpath += configurations.documentation From a505b2097f9ddebc57579d20adff92a62547d326 Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Fri, 1 Nov 2024 19:07:46 -0700 Subject: [PATCH 2/2] Remove no longer needed configuraitons.all closures --- build.gradle | 16 ---------------- docs/build.gradle | 8 -------- examples/spring-boot-hibernate5/build.gradle | 11 ++--------- gradle.properties | 1 - 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/build.gradle b/build.gradle index 6d7f45c9..d32810fe 100644 --- a/build.gradle +++ b/build.gradle @@ -94,22 +94,6 @@ subprojects { Project subproject -> } } - configurations.all { Configuration configuration-> - configuration.resolutionStrategy.eachDependency { DependencyResolveDetails details -> - if(details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) { - details.useVersion(groovyVersion) - } - if (details.requested.group == "org.grails" && details.requested.name.contains("testing-support")) { - details.useVersion(testingSupportVersion) - } - if(details.requested.group == 'org.grails' && - details.requested.name.startsWith('grails-datastore') && - details.requested.name != 'grails-datastore-gorm-hibernate5') { - details.useVersion(gormVersion) - } - } - } - dependencies { implementation platform("org.grails:grails-bom:$grailsVersion") testImplementation "jakarta.annotation:jakarta.annotation-api" diff --git a/docs/build.gradle b/docs/build.gradle index 17e381fd..b0e4f69c 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -17,14 +17,6 @@ version rootProject.version apply plugin: 'groovy' apply plugin: 'org.asciidoctor.jvm.convert' -configurations.all { - resolutionStrategy.eachDependency { DependencyResolveDetails details -> - if (details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) { - details.useVersion(groovyVersion) - } - } -} - dependencies { documentation "org.grails:grails-core:$grailsVersion" documentation "org.grails:grails-bootstrap:$grailsVersion" diff --git a/examples/spring-boot-hibernate5/build.gradle b/examples/spring-boot-hibernate5/build.gradle index e19225c4..140b6787 100644 --- a/examples/spring-boot-hibernate5/build.gradle +++ b/examples/spring-boot-hibernate5/build.gradle @@ -4,23 +4,16 @@ buildscript { mavenCentral() } dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") + classpath("org.springframework.boot:spring-boot-gradle-plugin:3.3.5") } } apply plugin: 'java' apply plugin: 'org.springframework.boot' -apply plugin:"groovy" +apply plugin: "groovy" group 'examples' -configurations.all { - resolutionStrategy.eachDependency { DependencyResolveDetails details -> - if(details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) { - details.useVersion(groovyVersion) - } - } -} dependencies { implementation("org.springframework.boot:spring-boot-starter") implementation("org.springframework.boot:spring-boot-starter-web") diff --git a/gradle.properties b/gradle.properties index 4941b71d..eb1a3fce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,7 +31,6 @@ servletApiVersion=6.0.0 snakeYamlVersion=2.3 slf4jVersion=2.0.16 spockVersion=2.3-groovy-4.0 -springBootVersion=3.3.5 testingSupportVersion=4.0.0-SNAPSHOT tomcatLog4jVersion=8.5.2 tomcatVersion=10.1.31