From ac43bba3500cce8e4d6ac1d33f745ad6b93654e7 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Fri, 29 May 2026 16:59:27 -0400 Subject: [PATCH 1/7] Update Spock to 2.4-groovy-4.0 and align test dependencies Upgrade Spock from 2.3-groovy-4.0 to the latest stable 2.4-groovy-4.0 (both spock.version and gradle-spock.version), and bump selenium-bom from 4.38.0 to 4.44.0 for the Geb functional tests. JUnit (6.0.3) already matches Spring Boot's managed junit-jupiter, byte-buddy (1.18.8) keeps its existing deliberate override, and objenesis (3.4) and geb-spock (8.0.1) are already at their latest, so they are left unchanged. Spock 2.4 introduces a new required runtime dependency, io.leangen.geantyref:geantyref:1.3.16, used by its mocking engine (GenericTypeReflectorUtil). Modules that declare spock-core with `transitive = false` strip this dependency, which breaks mock creation. geantyref is therefore: - added to the BOM (gradleBomDependencies) so it is version-managed and flows transitively to consumers and generated applications, and - declared explicitly next to byte-buddy/objenesis in every framework module that strips Spock's transitives. Generated applications (grails-forge and grails-profiles) declare spock-core transitively, so they receive geantyref automatically at the BOM-managed version - no generator/template changes are required. grails-forge's own spockVersion is bumped to 2.4-groovy-4.0 for branch consistency; its tests use transitive spock, so geantyref flows in without an explicit declaration. Assisted-by: claude-code:claude-opus-4-8 --- dependencies.gradle | 8 +++++--- grails-async/core/build.gradle | 1 + grails-bootstrap/build.gradle | 1 + grails-codecs-core/build.gradle | 1 + grails-codecs/build.gradle | 1 + grails-console/build.gradle | 1 + grails-controllers/build.gradle | 1 + grails-converters/build.gradle | 1 + grails-core/build.gradle | 1 + grails-data-graphql/core/build.gradle | 1 + grails-databinding-core/build.gradle | 1 + grails-databinding/build.gradle | 1 + grails-datasource/build.gradle | 1 + grails-domain-class/build.gradle | 1 + grails-encoder/build.gradle | 1 + grails-forge/gradle.properties | 2 +- grails-gradle/model/build.gradle | 1 + grails-gsp/grails-sitemesh3/build.gradle | 1 + grails-i18n/build.gradle | 1 + grails-interceptors/build.gradle | 1 + grails-logging/build.gradle | 1 + grails-mimetypes/build.gradle | 1 + grails-rest-transforms/build.gradle | 1 + grails-services/build.gradle | 1 + grails-shell-cli/build.gradle | 1 + grails-spring/build.gradle | 1 + grails-test-core/build.gradle | 2 ++ grails-test-suite-base/build.gradle | 1 + grails-test-suite-persistence/build.gradle | 1 + grails-test-suite-uber/build.gradle | 1 + grails-testing-support-core/build.gradle | 1 + grails-url-mappings/build.gradle | 1 + grails-validation/build.gradle | 1 + grails-web-boot/build.gradle | 1 + grails-web-common/build.gradle | 1 + grails-web-core/build.gradle | 1 + grails-web-databinding/build.gradle | 1 + grails-web-mvc/build.gradle | 1 + grails-web-url-mappings/build.gradle | 1 + 39 files changed, 44 insertions(+), 4 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index d2a51fb8e09..1f91fc2b3b6 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -29,8 +29,9 @@ ext { 'byte-buddy.version' : '1.18.8', 'commons-text.version' : '1.15.0', 'directory-watcher.version' : '0.19.1', + 'geantyref.version' : '1.3.16', 'gradle-groovy.version' : '4.0.32', - 'gradle-spock.version' : '2.3-groovy-4.0', + 'gradle-spock.version' : '2.4-groovy-4.0', 'grails-publish-plugin.version' : '1.0.0-M1', 'jansi.version' : '2.4.2', 'javaparser-core.version' : '3.28.0', @@ -59,6 +60,7 @@ ext { 'byte-buddy' : "net.bytebuddy:byte-buddy:${gradleBomDependencyVersions['byte-buddy.version']}", 'commons-text' : "org.apache.commons:commons-text:${gradleBomDependencyVersions['commons-text.version']}", 'directory-watcher' : "io.methvin:directory-watcher:${gradleBomDependencyVersions['directory-watcher.version']}", + 'geantyref' : "io.leangen.geantyref:geantyref:${gradleBomDependencyVersions['geantyref.version']}", 'grails-publish-plugin' : "org.apache.grails.gradle:grails-publish:${gradleBomDependencyVersions['grails-publish-plugin.version']}", 'jansi' : "org.fusesource.jansi:jansi:${gradleBomDependencyVersions['jansi.version']}", 'javaparser-core' : "com.github.javaparser:javaparser-core:${gradleBomDependencyVersions['javaparser-core.version']}", @@ -90,9 +92,9 @@ ext { 'rxjava.version' : '1.3.8', 'rxjava2.version' : '2.2.21', 'rxjava3.version' : '3.1.12', - 'selenium.version' : '4.38.0', + 'selenium.version' : '4.44.0', 'sitemesh.version' : '2.6.0', - 'spock.version' : '2.3-groovy-4.0', + 'spock.version' : '2.4-groovy-4.0', 'starter-sitemesh.version' : '3.2.2', 'spring-webmvc-sitemesh.version': '3.2.2', // Spring Boot 4 no longer manages spring-retry; pin it here so the diff --git a/grails-async/core/build.gradle b/grails-async/core/build.gradle index cee4816f2ea..d65f8917345 100644 --- a/grails-async/core/build.gradle +++ b/grails-async/core/build.gradle @@ -46,6 +46,7 @@ dependencies { testRuntimeOnly 'net.bytebuddy:byte-buddy' testRuntimeOnly 'org.objenesis:objenesis' + testRuntimeOnly 'io.leangen.geantyref:geantyref' testRuntimeOnly 'org.slf4j:slf4j-nop' // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-bootstrap/build.gradle b/grails-bootstrap/build.gradle index 8326c9da519..dba94887d08 100644 --- a/grails-bootstrap/build.gradle +++ b/grails-bootstrap/build.gradle @@ -77,6 +77,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } processResources { diff --git a/grails-codecs-core/build.gradle b/grails-codecs-core/build.gradle index a6e2562f863..6ccfa36c7c2 100644 --- a/grails-codecs-core/build.gradle +++ b/grails-codecs-core/build.gradle @@ -55,6 +55,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-codecs/build.gradle b/grails-codecs/build.gradle index 0e612cbb19b..e404808c264 100644 --- a/grails-codecs/build.gradle +++ b/grails-codecs/build.gradle @@ -65,6 +65,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-console/build.gradle b/grails-console/build.gradle index d3ec60a3f1d..7f05cc0962e 100644 --- a/grails-console/build.gradle +++ b/grails-console/build.gradle @@ -70,6 +70,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-controllers/build.gradle b/grails-controllers/build.gradle index dc68dacf8fe..af0c24cc440 100644 --- a/grails-controllers/build.gradle +++ b/grails-controllers/build.gradle @@ -79,6 +79,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-converters/build.gradle b/grails-converters/build.gradle index 0bb79ca3763..5d77ea3fd12 100644 --- a/grails-converters/build.gradle +++ b/grails-converters/build.gradle @@ -74,6 +74,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-core/build.gradle b/grails-core/build.gradle index 7e486bfaaef..bcb16e0065a 100644 --- a/grails-core/build.gradle +++ b/grails-core/build.gradle @@ -85,6 +85,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } TaskProvider writeProps = tasks.register('writeGrailsProperties', WriteProperties) diff --git a/grails-data-graphql/core/build.gradle b/grails-data-graphql/core/build.gradle index e2156f62ec5..79d248d9ef4 100644 --- a/grails-data-graphql/core/build.gradle +++ b/grails-data-graphql/core/build.gradle @@ -61,6 +61,7 @@ dependencies { testImplementation 'org.apache.tomcat:tomcat-jdbc' testImplementation 'org.slf4j:slf4j-api' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' testImplementation 'net.bytebuddy:byte-buddy' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-databinding-core/build.gradle b/grails-databinding-core/build.gradle index cf2bf90b51d..9062cf22e17 100644 --- a/grails-databinding-core/build.gradle +++ b/grails-databinding-core/build.gradle @@ -58,6 +58,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-databinding/build.gradle b/grails-databinding/build.gradle index 86b4fe0f048..aa937fab597 100644 --- a/grails-databinding/build.gradle +++ b/grails-databinding/build.gradle @@ -71,6 +71,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-datasource/build.gradle b/grails-datasource/build.gradle index a6ed818743b..0978a68df41 100644 --- a/grails-datasource/build.gradle +++ b/grails-datasource/build.gradle @@ -72,6 +72,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-domain-class/build.gradle b/grails-domain-class/build.gradle index a34f2607f95..8a0535e3ff5 100644 --- a/grails-domain-class/build.gradle +++ b/grails-domain-class/build.gradle @@ -82,6 +82,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-encoder/build.gradle b/grails-encoder/build.gradle index a1cac6930e8..42134fea0aa 100644 --- a/grails-encoder/build.gradle +++ b/grails-encoder/build.gradle @@ -59,6 +59,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-forge/gradle.properties b/grails-forge/gradle.properties index 0a3e6f66906..c0d59d85e33 100644 --- a/grails-forge/gradle.properties +++ b/grails-forge/gradle.properties @@ -54,7 +54,7 @@ rockerVersion=2.2.1 shadowVersion=8.3.6 slf4jVersion=2.0.17 snakeyamlVersion=2.4 -spockVersion=2.3-groovy-4.0 +spockVersion=2.4-groovy-4.0 spotlessVersion=6.25.0 testRetryVersion=1.6.2 typesafeConfigVersion=1.4.3 diff --git a/grails-gradle/model/build.gradle b/grails-gradle/model/build.gradle index 23f4e81e021..22f68841d32 100644 --- a/grails-gradle/model/build.gradle +++ b/grails-gradle/model/build.gradle @@ -78,6 +78,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-gsp/grails-sitemesh3/build.gradle b/grails-gsp/grails-sitemesh3/build.gradle index 676039b0355..fb4f0c972f2 100644 --- a/grails-gsp/grails-sitemesh3/build.gradle +++ b/grails-gsp/grails-sitemesh3/build.gradle @@ -58,6 +58,7 @@ dependencies { testImplementation 'org.springframework:spring-test' testImplementation project(':grails-testing-support-web') testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' testRuntimeOnly 'net.bytebuddy:byte-buddy' testRuntimeOnly 'org.slf4j:slf4j-nop' } diff --git a/grails-i18n/build.gradle b/grails-i18n/build.gradle index ad7785dbfc6..a3569cc375a 100644 --- a/grails-i18n/build.gradle +++ b/grails-i18n/build.gradle @@ -66,6 +66,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-interceptors/build.gradle b/grails-interceptors/build.gradle index 7d18d14b91e..0e9327cbbee 100644 --- a/grails-interceptors/build.gradle +++ b/grails-interceptors/build.gradle @@ -64,6 +64,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-logging/build.gradle b/grails-logging/build.gradle index 9ba07de8269..b385746fefb 100644 --- a/grails-logging/build.gradle +++ b/grails-logging/build.gradle @@ -55,6 +55,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-mimetypes/build.gradle b/grails-mimetypes/build.gradle index 0391a333643..effddc02400 100644 --- a/grails-mimetypes/build.gradle +++ b/grails-mimetypes/build.gradle @@ -63,6 +63,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-rest-transforms/build.gradle b/grails-rest-transforms/build.gradle index 3cbfdba682f..f92f0455ac1 100644 --- a/grails-rest-transforms/build.gradle +++ b/grails-rest-transforms/build.gradle @@ -79,6 +79,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-services/build.gradle b/grails-services/build.gradle index eda69a8eafd..b6b4eb91e9c 100644 --- a/grails-services/build.gradle +++ b/grails-services/build.gradle @@ -66,6 +66,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-shell-cli/build.gradle b/grails-shell-cli/build.gradle index 1843aa8825c..f3755791e6f 100644 --- a/grails-shell-cli/build.gradle +++ b/grails-shell-cli/build.gradle @@ -109,6 +109,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' // any project that should be included in the end distribution should be included here // historically these were the included projects so we have trimmed them back down to pre7.0 diff --git a/grails-spring/build.gradle b/grails-spring/build.gradle index 574091c26e5..13a6b1fcf7a 100644 --- a/grails-spring/build.gradle +++ b/grails-spring/build.gradle @@ -59,6 +59,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-test-core/build.gradle b/grails-test-core/build.gradle index 82af7708ce1..2786b376e01 100644 --- a/grails-test-core/build.gradle +++ b/grails-test-core/build.gradle @@ -61,6 +61,7 @@ dependencies { // needed for Spock api 'org.objenesis:objenesis' + api 'io.leangen.geantyref:geantyref' compileOnly 'jakarta.servlet:jakarta.servlet-api' compileOnly 'org.springframework:spring-test', { @@ -86,6 +87,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-test-suite-base/build.gradle b/grails-test-suite-base/build.gradle index 453cb33570f..f472d547d5d 100644 --- a/grails-test-suite-base/build.gradle +++ b/grails-test-suite-base/build.gradle @@ -69,6 +69,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } tasks.withType(Groovydoc).configureEach { diff --git a/grails-test-suite-persistence/build.gradle b/grails-test-suite-persistence/build.gradle index b9f02f2c907..0ad43aa9e76 100644 --- a/grails-test-suite-persistence/build.gradle +++ b/grails-test-suite-persistence/build.gradle @@ -87,6 +87,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } test { diff --git a/grails-test-suite-uber/build.gradle b/grails-test-suite-uber/build.gradle index 9c9246be46f..ae9da89510f 100644 --- a/grails-test-suite-uber/build.gradle +++ b/grails-test-suite-uber/build.gradle @@ -68,6 +68,7 @@ dependencies { } testImplementation project(':grails-datamapping-validation') testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' testCompileOnly 'jakarta.servlet:jakarta.servlet-api' testCompileOnly 'org.springframework:spring-test', { diff --git a/grails-testing-support-core/build.gradle b/grails-testing-support-core/build.gradle index 11d60439dd5..2f9eea6d998 100644 --- a/grails-testing-support-core/build.gradle +++ b/grails-testing-support-core/build.gradle @@ -73,6 +73,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-url-mappings/build.gradle b/grails-url-mappings/build.gradle index 720b4ba50dd..aac2a4066c3 100644 --- a/grails-url-mappings/build.gradle +++ b/grails-url-mappings/build.gradle @@ -67,6 +67,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-validation/build.gradle b/grails-validation/build.gradle index 22cf4c820a1..c10cd7843ba 100644 --- a/grails-validation/build.gradle +++ b/grails-validation/build.gradle @@ -64,6 +64,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-web-boot/build.gradle b/grails-web-boot/build.gradle index 755fe01739f..e419bee1f94 100644 --- a/grails-web-boot/build.gradle +++ b/grails-web-boot/build.gradle @@ -69,6 +69,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-web-common/build.gradle b/grails-web-common/build.gradle index 1053fba613f..3592bde034e 100644 --- a/grails-web-common/build.gradle +++ b/grails-web-common/build.gradle @@ -79,6 +79,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-web-core/build.gradle b/grails-web-core/build.gradle index 2b60e56ea90..34f96b6f444 100644 --- a/grails-web-core/build.gradle +++ b/grails-web-core/build.gradle @@ -73,6 +73,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-web-databinding/build.gradle b/grails-web-databinding/build.gradle index 3fc3cd3578f..98bbb9fa2ae 100644 --- a/grails-web-databinding/build.gradle +++ b/grails-web-databinding/build.gradle @@ -76,6 +76,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-web-mvc/build.gradle b/grails-web-mvc/build.gradle index ac72a8621b2..8d364d8e6c3 100644 --- a/grails-web-mvc/build.gradle +++ b/grails-web-mvc/build.gradle @@ -64,6 +64,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-web-url-mappings/build.gradle b/grails-web-url-mappings/build.gradle index adcd1f6579c..839be48a866 100644 --- a/grails-web-url-mappings/build.gradle +++ b/grails-web-url-mappings/build.gradle @@ -80,6 +80,7 @@ dependencies { // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' + testImplementation 'io.leangen.geantyref:geantyref' } apply { From 7bda7b6e0946a93bc45e38749cb900a5c57e91a6 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Fri, 29 May 2026 17:15:59 -0400 Subject: [PATCH 2/7] Fix CI: keep selenium at 4.38.0 and update Spock jar version assertion The selenium 4.44.0 bump dragged OpenTelemetry up to 1.62.0, above the 1.55.0 managed by Spring Boot 4.0.6, failing validateDependencyVersions for grails-geb and the functional test example apps. selenium 4.38.0 is the version whose OpenTelemetry (1.55.0) matches Boot exactly, so it is restored (geb-spock is already at its latest 8.0.1, so nothing else to bump on the Geb/Selenium side). Also update IOUtilsSpec in grails-gradle-model, which asserts the expected spock-core jar name, from 2.3-groovy-4.0 to 2.4-groovy-4.0, and refresh the now-stale Spock version references in AGENTS.md and a settings.gradle comment. Assisted-by: claude-code:claude-opus-4-8 --- AGENTS.md | 2 +- dependencies.gradle | 2 +- .../model/src/test/groovy/grails/io/IOUtilsSpec.groovy | 2 +- settings.gradle | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3094ce4a58f..c23b59d6e4e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -75,7 +75,7 @@ export GRADLE_OPTS="-Xms2G -Xmx5G" | Groovy | 4.0.x | | Spring Boot | 4.0.x | | Spring Framework | 7.0.x | -| Spock | 2.3-groovy-4.0 | +| Spock | 2.4-groovy-4.0 | | Gradle | 8.14.x | | Jakarta EE | 10 | diff --git a/dependencies.gradle b/dependencies.gradle index 1f91fc2b3b6..ecb0e5d93da 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -92,7 +92,7 @@ ext { 'rxjava.version' : '1.3.8', 'rxjava2.version' : '2.2.21', 'rxjava3.version' : '3.1.12', - 'selenium.version' : '4.44.0', + 'selenium.version' : '4.38.0', 'sitemesh.version' : '2.6.0', 'spock.version' : '2.4-groovy-4.0', 'starter-sitemesh.version' : '3.2.2', diff --git a/grails-gradle/model/src/test/groovy/grails/io/IOUtilsSpec.groovy b/grails-gradle/model/src/test/groovy/grails/io/IOUtilsSpec.groovy index 24dec7ccac7..34d713c63ab 100644 --- a/grails-gradle/model/src/test/groovy/grails/io/IOUtilsSpec.groovy +++ b/grails-gradle/model/src/test/groovy/grails/io/IOUtilsSpec.groovy @@ -32,7 +32,7 @@ class IOUtilsSpec extends Specification { void "Test findJarResource finds a JAR resource"() { expect: IOUtils.findJarResource(Specification) - IOUtils.findJarResource(Specification).path.endsWith('spock-core-2.3-groovy-4.0.jar!/') + IOUtils.findJarResource(Specification).path.endsWith('spock-core-2.4-groovy-4.0.jar!/') } void 'findRootResourcesURL - appends / if not present'() { diff --git a/settings.gradle b/settings.gradle index 969f1c7f65c..5bfb785953e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -504,7 +504,7 @@ includeBuild('./build-logic') { // Grails-Micronaut "island" - kept on its own dependency graph because the Micronaut // platform pins Groovy 5 / Spock 2.4-groovy-5.0, which is incompatible with the -// Groovy 4 / Spock 2.3-groovy-4.0 stack the rest of grails-core targets. Skipping +// Groovy 4 / Spock 2.4-groovy-4.0 stack the rest of grails-core targets. Skipping // these projects (via -PskipMicronautProjects) keeps Micronaut's version overrides // from leaking into builds where Groovy 4 is in play (notably the joint validation // build that swaps in an apache/groovy 4.x snapshot). From 3e6dabc97cdff6b086b363a6eff1bd9c8ac0ce93 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Fri, 29 May 2026 18:25:34 -0400 Subject: [PATCH 3/7] Fix Spock 2.4 test incompatibilities in views-gson and datamapping-core Spock 2.4 tightened two behaviors that two existing tests relied on: - JsonViewTemplateResolverSpec stubbed the final methods getRequest() and getResponse() on a GrailsWebRequest mock. Spock 2.3 silently ignored final-method stubs; Spock 2.4's byte-buddy mock maker fails fast with InvalidSpecException. The stubs were dead (the test passes the request and response to resolveView() explicitly), so they are removed. - TransactionalTransformSpec reflectively invoked the @Rollback-transformed Spock feature methods directly, outside Spock's runner. Spock 2.4 throws IllegalStateException ("Cannot request current iteration") for closures that reference data variables or contain conditions when there is no active iteration. The direct call was never faithful to real Spock execution; the GroovyShell compilation plus the transformed method-signature assertions already cover the #9837 and #9646 regressions, so the direct-invocation blocks are removed. Assisted-by: claude-code:claude-opus-4-8 --- .../transactions/TransactionalTransformSpec.groovy | 14 ++++++++++---- .../json/view/JsonViewTemplateResolverSpec.groovy | 2 -- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/grails-datamapping-core/src/test/groovy/grails/gorm/annotation/transactions/TransactionalTransformSpec.groovy b/grails-datamapping-core/src/test/groovy/grails/gorm/annotation/transactions/TransactionalTransformSpec.groovy index 62ca6a7640f..90096e27547 100644 --- a/grails-datamapping-core/src/test/groovy/grails/gorm/annotation/transactions/TransactionalTransformSpec.groovy +++ b/grails-datamapping-core/src/test/groovy/grails/gorm/annotation/transactions/TransactionalTransformSpec.groovy @@ -197,8 +197,11 @@ import grails.gorm.transactions.Transactional mySpec.getDeclaredMethod('$spock_feature_0_0', Object, Object, Object) mySpec.getDeclaredMethod('$tt__$spock_feature_0_0', Object, Object, Object, TransactionStatus) - and:"The spec can be called" - mySpec.newInstance().'$tt__$spock_feature_0_0'(2,2,4,new DefaultTransactionStatus(null, new Object(), true, true, false, false, false, null)) + // Do not invoke the transformed Spock feature method directly here: Spock 2.4 + // requires an active iteration context for closures that reference data variables, + // so a reflective call outside Spock's runner throws IllegalStateException. The + // GroovyShell compilation above plus the transformed method signature checks + // already cover this regression (@Rollback must produce a valid, well-formed spec). } @@ -231,8 +234,11 @@ import grails.gorm.transactions.Transactional mySpec.getDeclaredMethod('$spock_feature_0_0') mySpec.getDeclaredMethod('$tt__$spock_feature_0_0', TransactionStatus) - and:"The spec can be called" - mySpec.newInstance().'$tt__$spock_feature_0_0'(new DefaultTransactionStatus(null, new Object(), true, true, false, false, false, null)) + // Do not invoke the transformed Spock feature method directly here: Spock 2.4 + // requires an active iteration context for closures containing conditions, so a + // reflective call outside Spock's runner throws IllegalStateException. The + // GroovyShell compilation above plus the transformed method signature checks + // already cover this regression (@Rollback must produce a valid, well-formed spec). } diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/JsonViewTemplateResolverSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/JsonViewTemplateResolverSpec.groovy index 8e2074407ad..342f6a143f1 100644 --- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/JsonViewTemplateResolverSpec.groovy +++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/JsonViewTemplateResolverSpec.groovy @@ -78,8 +78,6 @@ class JsonViewTemplateResolverSpec extends Specification { request.getHeader(HttpHeaders.ACCEPT_VERSION) >> "1.1" request.getLocale() >> Locale.ENGLISH webRequest.getCurrentRequest() >> request - webRequest.getRequest() >> request - webRequest.getResponse() >> response def templateResolver = Mock(TemplateResolver) viewResolver.templateResolver = templateResolver From 8254d63ff3af71aa87a3272836001b5dba1abb02 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Fri, 5 Jun 2026 12:36:43 +0200 Subject: [PATCH 4/7] fix(deps): Remove Spock transitive dependency exclusion --- dependencies.gradle | 2 -- grails-async/core/build.gradle | 1 - grails-bootstrap/build.gradle | 3 +-- grails-cache/build.gradle | 4 +--- grails-codecs-core/build.gradle | 2 -- grails-codecs/build.gradle | 3 +-- grails-console/build.gradle | 3 +-- grails-controllers/build.gradle | 3 +-- grails-converters/build.gradle | 3 +-- grails-core/build.gradle | 3 +-- grails-data-graphql/core/build.gradle | 1 - grails-databinding-core/build.gradle | 3 +-- grails-databinding/build.gradle | 3 +-- grails-datasource/build.gradle | 3 +-- grails-domain-class/build.gradle | 3 +-- grails-encoder/build.gradle | 3 +-- grails-gradle/model/build.gradle | 5 +---- grails-gsp/grails-sitemesh3/build.gradle | 1 - grails-i18n/build.gradle | 3 +-- grails-interceptors/build.gradle | 3 +-- grails-logging/build.gradle | 3 +-- grails-mimetypes/build.gradle | 3 +-- grails-rest-transforms/build.gradle | 3 +-- grails-services/build.gradle | 3 +-- grails-shell-cli/build.gradle | 3 +-- grails-spring/build.gradle | 3 +-- grails-test-core/build.gradle | 6 ++---- grails-test-suite-base/build.gradle | 3 +-- grails-test-suite-persistence/build.gradle | 3 +-- grails-test-suite-uber/build.gradle | 3 +-- grails-testing-support-core/build.gradle | 3 +-- grails-url-mappings/build.gradle | 3 +-- grails-validation/build.gradle | 3 +-- grails-web-boot/build.gradle | 3 +-- grails-web-common/build.gradle | 3 +-- grails-web-core/build.gradle | 3 +-- grails-web-databinding/build.gradle | 3 +-- grails-web-mvc/build.gradle | 3 +-- grails-web-url-mappings/build.gradle | 3 +-- 39 files changed, 35 insertions(+), 80 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index caf9931b149..7156acc4f38 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -29,7 +29,6 @@ ext { 'byte-buddy.version' : '1.18.8', 'commons-text.version' : '1.15.0', 'directory-watcher.version' : '0.19.1', - 'geantyref.version' : '1.3.16', 'gradle-groovy.version' : '4.0.32', 'gradle-spock.version' : '2.4-groovy-4.0', 'grails-publish-plugin.version' : '1.0.0-M1', @@ -60,7 +59,6 @@ ext { 'byte-buddy' : "net.bytebuddy:byte-buddy:${gradleBomDependencyVersions['byte-buddy.version']}", 'commons-text' : "org.apache.commons:commons-text:${gradleBomDependencyVersions['commons-text.version']}", 'directory-watcher' : "io.methvin:directory-watcher:${gradleBomDependencyVersions['directory-watcher.version']}", - 'geantyref' : "io.leangen.geantyref:geantyref:${gradleBomDependencyVersions['geantyref.version']}", 'grails-publish-plugin' : "org.apache.grails.gradle:grails-publish:${gradleBomDependencyVersions['grails-publish-plugin.version']}", 'jansi' : "org.fusesource.jansi:jansi:${gradleBomDependencyVersions['jansi.version']}", 'javaparser-core' : "com.github.javaparser:javaparser-core:${gradleBomDependencyVersions['javaparser-core.version']}", diff --git a/grails-async/core/build.gradle b/grails-async/core/build.gradle index 4e76fbf004c..66603feeb0c 100644 --- a/grails-async/core/build.gradle +++ b/grails-async/core/build.gradle @@ -47,7 +47,6 @@ dependencies { testRuntimeOnly 'net.bytebuddy:byte-buddy' testRuntimeOnly 'org.objenesis:objenesis' - testRuntimeOnly 'io.leangen.geantyref:geantyref' testRuntimeOnly 'org.slf4j:slf4j-nop' // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-bootstrap/build.gradle b/grails-bootstrap/build.gradle index fde05e8b8d3..0d555b0a8d4 100644 --- a/grails-bootstrap/build.gradle +++ b/grails-bootstrap/build.gradle @@ -74,11 +74,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } processResources { diff --git a/grails-cache/build.gradle b/grails-cache/build.gradle index b219bdcee11..6be0183332a 100644 --- a/grails-cache/build.gradle +++ b/grails-cache/build.gradle @@ -54,10 +54,8 @@ dependencies { testImplementation project(':grails-testing-support-datamapping') testImplementation project(':grails-testing-support-web') - testImplementation 'org.spockframework:spock-core', { - exclude group: 'org.apache.groovy' - } testImplementation 'org.mockito:mockito-core' // to allow for correct mocking with Mock() + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-codecs-core/build.gradle b/grails-codecs-core/build.gradle index 026df192c02..7640ad12994 100644 --- a/grails-codecs-core/build.gradle +++ b/grails-codecs-core/build.gradle @@ -52,11 +52,9 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-codecs/build.gradle b/grails-codecs/build.gradle index 3e9e7977904..237ef23908d 100644 --- a/grails-codecs/build.gradle +++ b/grails-codecs/build.gradle @@ -62,11 +62,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-console/build.gradle b/grails-console/build.gradle index 7a46c79414c..aab66c1aca3 100644 --- a/grails-console/build.gradle +++ b/grails-console/build.gradle @@ -67,11 +67,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-controllers/build.gradle b/grails-controllers/build.gradle index 012abaab641..650f5b4deeb 100644 --- a/grails-controllers/build.gradle +++ b/grails-controllers/build.gradle @@ -76,11 +76,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } + testImplementation 'org.spockframework:spock-core' // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-converters/build.gradle b/grails-converters/build.gradle index 05697c3833a..7497289ece9 100644 --- a/grails-converters/build.gradle +++ b/grails-converters/build.gradle @@ -71,11 +71,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-core/build.gradle b/grails-core/build.gradle index 472affa25cf..006f09fde15 100644 --- a/grails-core/build.gradle +++ b/grails-core/build.gradle @@ -82,11 +82,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } TaskProvider writeProps = tasks.register('writeGrailsProperties', WriteProperties) diff --git a/grails-data-graphql/core/build.gradle b/grails-data-graphql/core/build.gradle index 79d248d9ef4..e2156f62ec5 100644 --- a/grails-data-graphql/core/build.gradle +++ b/grails-data-graphql/core/build.gradle @@ -61,7 +61,6 @@ dependencies { testImplementation 'org.apache.tomcat:tomcat-jdbc' testImplementation 'org.slf4j:slf4j-api' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' testImplementation 'net.bytebuddy:byte-buddy' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-databinding-core/build.gradle b/grails-databinding-core/build.gradle index a0b613e160c..e6936e43791 100644 --- a/grails-databinding-core/build.gradle +++ b/grails-databinding-core/build.gradle @@ -54,12 +54,11 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-databinding/build.gradle b/grails-databinding/build.gradle index 6060a31a185..b088233081b 100644 --- a/grails-databinding/build.gradle +++ b/grails-databinding/build.gradle @@ -68,11 +68,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-datasource/build.gradle b/grails-datasource/build.gradle index 29f0ce9270d..64a47f21322 100644 --- a/grails-datasource/build.gradle +++ b/grails-datasource/build.gradle @@ -69,11 +69,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-domain-class/build.gradle b/grails-domain-class/build.gradle index 8c6f6a4db05..eafb8ead86e 100644 --- a/grails-domain-class/build.gradle +++ b/grails-domain-class/build.gradle @@ -79,11 +79,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-encoder/build.gradle b/grails-encoder/build.gradle index 7013ab76670..4cd353b5b1e 100644 --- a/grails-encoder/build.gradle +++ b/grails-encoder/build.gradle @@ -56,11 +56,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-gradle/model/build.gradle b/grails-gradle/model/build.gradle index b7a1a42c57b..d2f6c4b0e60 100644 --- a/grails-gradle/model/build.gradle +++ b/grails-gradle/model/build.gradle @@ -73,13 +73,10 @@ dependencies { testImplementation 'org.apache.groovy:groovy' testImplementation 'org.apache.groovy:groovy-xml' testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { - transitive = false - } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-gsp/grails-sitemesh3/build.gradle b/grails-gsp/grails-sitemesh3/build.gradle index e85f83575fe..74829416a10 100644 --- a/grails-gsp/grails-sitemesh3/build.gradle +++ b/grails-gsp/grails-sitemesh3/build.gradle @@ -59,7 +59,6 @@ dependencies { testImplementation 'org.springframework:spring-test' testImplementation project(':grails-testing-support-web') testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' testRuntimeOnly 'net.bytebuddy:byte-buddy' testRuntimeOnly 'org.slf4j:slf4j-nop' } diff --git a/grails-i18n/build.gradle b/grails-i18n/build.gradle index 9d824ccdc46..7a23cf12064 100644 --- a/grails-i18n/build.gradle +++ b/grails-i18n/build.gradle @@ -63,11 +63,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-interceptors/build.gradle b/grails-interceptors/build.gradle index 1a968ecd319..97005ff9585 100644 --- a/grails-interceptors/build.gradle +++ b/grails-interceptors/build.gradle @@ -61,11 +61,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-logging/build.gradle b/grails-logging/build.gradle index ee34ac30319..3801165f94d 100644 --- a/grails-logging/build.gradle +++ b/grails-logging/build.gradle @@ -52,11 +52,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-mimetypes/build.gradle b/grails-mimetypes/build.gradle index da97d317775..c1d54a32a8b 100644 --- a/grails-mimetypes/build.gradle +++ b/grails-mimetypes/build.gradle @@ -60,11 +60,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-rest-transforms/build.gradle b/grails-rest-transforms/build.gradle index 3cd01e273d9..803be7fe083 100644 --- a/grails-rest-transforms/build.gradle +++ b/grails-rest-transforms/build.gradle @@ -76,11 +76,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-services/build.gradle b/grails-services/build.gradle index e0a0105e132..6d806b3e16d 100644 --- a/grails-services/build.gradle +++ b/grails-services/build.gradle @@ -63,11 +63,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-shell-cli/build.gradle b/grails-shell-cli/build.gradle index 32d4f6d85fd..a3f80f31e4d 100644 --- a/grails-shell-cli/build.gradle +++ b/grails-shell-cli/build.gradle @@ -106,11 +106,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' // any project that should be included in the end distribution should be included here // historically these were the included projects so we have trimmed them back down to pre7.0 diff --git a/grails-spring/build.gradle b/grails-spring/build.gradle index d6d4f66b607..35bc2815882 100644 --- a/grails-spring/build.gradle +++ b/grails-spring/build.gradle @@ -56,11 +56,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-test-core/build.gradle b/grails-test-core/build.gradle index d38798fabb2..202666e9a9f 100644 --- a/grails-test-core/build.gradle +++ b/grails-test-core/build.gradle @@ -43,7 +43,7 @@ dependencies { // Testing api 'org.apache.groovy:groovy-test-junit5' api('org.apache.groovy:groovy-test') - api('org.spockframework:spock-core') { transitive = false } + api 'org.spockframework:spock-core' api 'org.junit.platform:junit-platform-suite' @@ -62,7 +62,6 @@ dependencies { // needed for Spock api 'org.objenesis:objenesis' - api 'io.leangen.geantyref:geantyref' compileOnly 'jakarta.servlet:jakarta.servlet-api' compileOnly 'org.springframework:spring-test', { @@ -84,11 +83,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } + testImplementation 'org.spockframework:spock-core' // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-test-suite-base/build.gradle b/grails-test-suite-base/build.gradle index 00fb629a8c2..080d527e73e 100644 --- a/grails-test-suite-base/build.gradle +++ b/grails-test-suite-base/build.gradle @@ -66,11 +66,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } + testImplementation 'org.spockframework:spock-core' // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' } tasks.withType(Groovydoc).configureEach { diff --git a/grails-test-suite-persistence/build.gradle b/grails-test-suite-persistence/build.gradle index 0ad43aa9e76..1b439aec939 100644 --- a/grails-test-suite-persistence/build.gradle +++ b/grails-test-suite-persistence/build.gradle @@ -83,11 +83,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } test { diff --git a/grails-test-suite-uber/build.gradle b/grails-test-suite-uber/build.gradle index ae9da89510f..fb46ebb7cb9 100644 --- a/grails-test-suite-uber/build.gradle +++ b/grails-test-suite-uber/build.gradle @@ -68,7 +68,6 @@ dependencies { } testImplementation project(':grails-datamapping-validation') testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' testCompileOnly 'jakarta.servlet:jakarta.servlet-api' testCompileOnly 'org.springframework:spring-test', { @@ -83,7 +82,7 @@ dependencies { testRuntimeOnly 'org.springframework:spring-aspects' // Testing - testImplementation('org.spockframework:spock-core') { transitive = false } + testImplementation 'org.spockframework:spock-core' // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' diff --git a/grails-testing-support-core/build.gradle b/grails-testing-support-core/build.gradle index 732aac74ac1..c77fa7a5c7b 100644 --- a/grails-testing-support-core/build.gradle +++ b/grails-testing-support-core/build.gradle @@ -70,11 +70,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-url-mappings/build.gradle b/grails-url-mappings/build.gradle index d3d32e77644..1e99fe688ac 100644 --- a/grails-url-mappings/build.gradle +++ b/grails-url-mappings/build.gradle @@ -64,11 +64,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-validation/build.gradle b/grails-validation/build.gradle index 9f470917a52..a247e72d288 100644 --- a/grails-validation/build.gradle +++ b/grails-validation/build.gradle @@ -61,11 +61,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-web-boot/build.gradle b/grails-web-boot/build.gradle index 5218bcfb315..08e8459ed8b 100644 --- a/grails-web-boot/build.gradle +++ b/grails-web-boot/build.gradle @@ -66,11 +66,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-web-common/build.gradle b/grails-web-common/build.gradle index 909d72c68ce..609140b058c 100644 --- a/grails-web-common/build.gradle +++ b/grails-web-common/build.gradle @@ -76,11 +76,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-web-core/build.gradle b/grails-web-core/build.gradle index 017acc69ea7..edc15d2743f 100644 --- a/grails-web-core/build.gradle +++ b/grails-web-core/build.gradle @@ -70,11 +70,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-web-databinding/build.gradle b/grails-web-databinding/build.gradle index e45a3789cfd..f9e265d5039 100644 --- a/grails-web-databinding/build.gradle +++ b/grails-web-databinding/build.gradle @@ -73,11 +73,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-web-mvc/build.gradle b/grails-web-mvc/build.gradle index 071b87f76d2..085d91888a0 100644 --- a/grails-web-mvc/build.gradle +++ b/grails-web-mvc/build.gradle @@ -61,11 +61,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } + testImplementation 'org.spockframework:spock-core' // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' } apply { diff --git a/grails-web-url-mappings/build.gradle b/grails-web-url-mappings/build.gradle index cadc13abd33..6e980c7e485 100644 --- a/grails-web-url-mappings/build.gradle +++ b/grails-web-url-mappings/build.gradle @@ -77,11 +77,10 @@ dependencies { // Testing testImplementation 'org.apache.grails:grails-controllers' // @Controller testImplementation 'org.slf4j:slf4j-simple' - testImplementation('org.spockframework:spock-core') { transitive = false } // Required by Spock's Mocking testRuntimeOnly 'net.bytebuddy:byte-buddy' testImplementation 'org.objenesis:objenesis' - testImplementation 'io.leangen.geantyref:geantyref' + testImplementation 'org.spockframework:spock-core' } apply { From afd0a2540e69b4536ff487ae520335b4c1144e05 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Fri, 5 Jun 2026 12:39:52 +0200 Subject: [PATCH 5/7] fix(deps): Cleanup and document Spock mocking dependencies --- grails-async/core/build.gradle | 4 ++-- grails-bootstrap/build.gradle | 3 --- grails-cache/build.gradle | 3 ++- grails-codecs-core/build.gradle | 4 +--- grails-codecs/build.gradle | 3 --- grails-console/build.gradle | 3 --- grails-controllers/build.gradle | 4 +--- grails-converters/build.gradle | 5 ++--- grails-core/build.gradle | 6 +++--- grails-data-graphql/core/build.gradle | 4 ++-- grails-data-graphql/plugin/build.gradle | 4 +++- grails-databinding-core/build.gradle | 4 ---- grails-databinding/build.gradle | 3 --- grails-datasource/build.gradle | 3 --- grails-domain-class/build.gradle | 3 --- grails-encoder/build.gradle | 3 --- grails-fields/build.gradle | 2 +- grails-gradle/model/build.gradle | 3 --- grails-gsp/grails-sitemesh3/build.gradle | 5 +++-- grails-i18n/build.gradle | 3 --- grails-interceptors/build.gradle | 3 --- grails-logging/build.gradle | 3 --- grails-mimetypes/build.gradle | 3 --- grails-rest-transforms/build.gradle | 3 --- grails-services/build.gradle | 3 --- grails-shell-cli/build.gradle | 5 ++--- grails-spring/build.gradle | 3 --- grails-test-suite-persistence/build.gradle | 3 --- grails-test-suite-uber/build.gradle | 8 +------- grails-testing-support-core/build.gradle | 3 --- grails-url-mappings/build.gradle | 3 --- grails-validation/build.gradle | 5 ++--- grails-views-gson/build.gradle | 1 + grails-web-boot/build.gradle | 3 --- grails-web-common/build.gradle | 3 --- grails-web-core/build.gradle | 3 --- grails-web-databinding/build.gradle | 3 --- grails-web-mvc/build.gradle | 4 +--- grails-web-url-mappings/build.gradle | 3 --- 39 files changed, 27 insertions(+), 110 deletions(-) diff --git a/grails-async/core/build.gradle b/grails-async/core/build.gradle index 66603feeb0c..3cf381d097e 100644 --- a/grails-async/core/build.gradle +++ b/grails-async/core/build.gradle @@ -45,8 +45,8 @@ dependencies { testImplementation 'org.spockframework:spock-core' - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testRuntimeOnly 'org.objenesis:objenesis' + testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's mocking support + testRuntimeOnly 'org.objenesis:objenesis' // Required by Spock for mocking classes without default constructor testRuntimeOnly 'org.slf4j:slf4j-nop' // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-bootstrap/build.gradle b/grails-bootstrap/build.gradle index 0d555b0a8d4..3890589602e 100644 --- a/grails-bootstrap/build.gradle +++ b/grails-bootstrap/build.gradle @@ -74,9 +74,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-cache/build.gradle b/grails-cache/build.gradle index 6be0183332a..23169b73943 100644 --- a/grails-cache/build.gradle +++ b/grails-cache/build.gradle @@ -54,8 +54,9 @@ dependencies { testImplementation project(':grails-testing-support-datamapping') testImplementation project(':grails-testing-support-web') - testImplementation 'org.mockito:mockito-core' // to allow for correct mocking with Mock() testImplementation 'org.spockframework:spock-core' + + testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's mocking support } apply { diff --git a/grails-codecs-core/build.gradle b/grails-codecs-core/build.gradle index 7640ad12994..1eb061aa654 100644 --- a/grails-codecs-core/build.gradle +++ b/grails-codecs-core/build.gradle @@ -52,9 +52,7 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-codecs/build.gradle b/grails-codecs/build.gradle index 237ef23908d..71a190531ac 100644 --- a/grails-codecs/build.gradle +++ b/grails-codecs/build.gradle @@ -62,9 +62,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-console/build.gradle b/grails-console/build.gradle index aab66c1aca3..f16ccfe3612 100644 --- a/grails-console/build.gradle +++ b/grails-console/build.gradle @@ -67,9 +67,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-controllers/build.gradle b/grails-controllers/build.gradle index 650f5b4deeb..624e25bd546 100644 --- a/grails-controllers/build.gradle +++ b/grails-controllers/build.gradle @@ -77,9 +77,7 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' testImplementation 'org.spockframework:spock-core' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-converters/build.gradle b/grails-converters/build.gradle index 7497289ece9..1a4033376eb 100644 --- a/grails-converters/build.gradle +++ b/grails-converters/build.gradle @@ -71,10 +71,9 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' + + testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's Mocking } apply { diff --git a/grails-core/build.gradle b/grails-core/build.gradle index 006f09fde15..696810b66f7 100644 --- a/grails-core/build.gradle +++ b/grails-core/build.gradle @@ -82,10 +82,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' + + testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's mocking support + testRuntimeOnly 'org.objenesis:objenesis' // Required by Spock for mocking classes without default constructor } TaskProvider writeProps = tasks.register('writeGrailsProperties', WriteProperties) diff --git a/grails-data-graphql/core/build.gradle b/grails-data-graphql/core/build.gradle index e2156f62ec5..9d88322dc59 100644 --- a/grails-data-graphql/core/build.gradle +++ b/grails-data-graphql/core/build.gradle @@ -60,9 +60,9 @@ dependencies { testImplementation 'com.h2database:h2' testImplementation 'org.apache.tomcat:tomcat-jdbc' testImplementation 'org.slf4j:slf4j-api' - testImplementation 'org.objenesis:objenesis' - testImplementation 'net.bytebuddy:byte-buddy' testImplementation 'org.spockframework:spock-core' + + testRuntimeOnly 'org.objenesis:objenesis' // Required by Spock for mocking classes without default constructor } apply { diff --git a/grails-data-graphql/plugin/build.gradle b/grails-data-graphql/plugin/build.gradle index c32901e795b..d0dee8816b2 100644 --- a/grails-data-graphql/plugin/build.gradle +++ b/grails-data-graphql/plugin/build.gradle @@ -84,8 +84,10 @@ dependencies { compileOnly "io.micronaut.rxjava2:micronaut-rxjava2-http-client:$micronautRxjava2Version" testImplementation project(':grails-testing-support-web') - testImplementation 'net.bytebuddy:byte-buddy' testImplementation 'org.spockframework:spock-core' + + testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's mocking support + testRuntimeOnly 'org.objenesis:objenesis' // Required by Spock for mocking classes without default constructor } compileGsonViews { diff --git a/grails-databinding-core/build.gradle b/grails-databinding-core/build.gradle index e6936e43791..d3e7390c899 100644 --- a/grails-databinding-core/build.gradle +++ b/grails-databinding-core/build.gradle @@ -54,10 +54,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-databinding/build.gradle b/grails-databinding/build.gradle index b088233081b..3992e60cc07 100644 --- a/grails-databinding/build.gradle +++ b/grails-databinding/build.gradle @@ -68,9 +68,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-datasource/build.gradle b/grails-datasource/build.gradle index 64a47f21322..8192f18bb02 100644 --- a/grails-datasource/build.gradle +++ b/grails-datasource/build.gradle @@ -69,9 +69,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-domain-class/build.gradle b/grails-domain-class/build.gradle index eafb8ead86e..b6371a44ce8 100644 --- a/grails-domain-class/build.gradle +++ b/grails-domain-class/build.gradle @@ -79,9 +79,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-encoder/build.gradle b/grails-encoder/build.gradle index 4cd353b5b1e..7bb40fdaef1 100644 --- a/grails-encoder/build.gradle +++ b/grails-encoder/build.gradle @@ -56,9 +56,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-fields/build.gradle b/grails-fields/build.gradle index 7f93d03123b..6bcabb414e3 100644 --- a/grails-fields/build.gradle +++ b/grails-fields/build.gradle @@ -58,7 +58,7 @@ dependencies { exclude module: 'asm' } - testRuntimeOnly 'net.bytebuddy:byte-buddy' + testRuntimeOnly 'org.objenesis:objenesis' // Required by Spock for mocking classes without default constructor } apply { diff --git a/grails-gradle/model/build.gradle b/grails-gradle/model/build.gradle index d2f6c4b0e60..c6bd8cfeeaa 100644 --- a/grails-gradle/model/build.gradle +++ b/grails-gradle/model/build.gradle @@ -73,9 +73,6 @@ dependencies { testImplementation 'org.apache.groovy:groovy' testImplementation 'org.apache.groovy:groovy-xml' testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-gsp/grails-sitemesh3/build.gradle b/grails-gsp/grails-sitemesh3/build.gradle index 74829416a10..9e0439b712f 100644 --- a/grails-gsp/grails-sitemesh3/build.gradle +++ b/grails-gsp/grails-sitemesh3/build.gradle @@ -58,8 +58,9 @@ dependencies { testImplementation 'org.spockframework:spock-core' testImplementation 'org.springframework:spring-test' testImplementation project(':grails-testing-support-web') - testImplementation 'org.objenesis:objenesis' - testRuntimeOnly 'net.bytebuddy:byte-buddy' + + testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's mocking support + testRuntimeOnly 'org.objenesis:objenesis' // Required by Spock for mocking classes without default constructor testRuntimeOnly 'org.slf4j:slf4j-nop' } diff --git a/grails-i18n/build.gradle b/grails-i18n/build.gradle index 7a23cf12064..2472c4e24cc 100644 --- a/grails-i18n/build.gradle +++ b/grails-i18n/build.gradle @@ -63,9 +63,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-interceptors/build.gradle b/grails-interceptors/build.gradle index 97005ff9585..a951191e381 100644 --- a/grails-interceptors/build.gradle +++ b/grails-interceptors/build.gradle @@ -61,9 +61,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-logging/build.gradle b/grails-logging/build.gradle index 3801165f94d..2aa55d1026f 100644 --- a/grails-logging/build.gradle +++ b/grails-logging/build.gradle @@ -52,9 +52,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-mimetypes/build.gradle b/grails-mimetypes/build.gradle index c1d54a32a8b..920ce8ab012 100644 --- a/grails-mimetypes/build.gradle +++ b/grails-mimetypes/build.gradle @@ -60,9 +60,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-rest-transforms/build.gradle b/grails-rest-transforms/build.gradle index 803be7fe083..a37cd17677c 100644 --- a/grails-rest-transforms/build.gradle +++ b/grails-rest-transforms/build.gradle @@ -76,9 +76,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-services/build.gradle b/grails-services/build.gradle index 6d806b3e16d..1e246ccfabb 100644 --- a/grails-services/build.gradle +++ b/grails-services/build.gradle @@ -63,9 +63,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-shell-cli/build.gradle b/grails-shell-cli/build.gradle index a3f80f31e4d..2bc8809af37 100644 --- a/grails-shell-cli/build.gradle +++ b/grails-shell-cli/build.gradle @@ -106,11 +106,10 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' + testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's mocking support + // any project that should be included in the end distribution should be included here // historically these were the included projects so we have trimmed them back down to pre7.0 shellCliDependencies project(':grails-codecs-core') diff --git a/grails-spring/build.gradle b/grails-spring/build.gradle index 35bc2815882..e5318b54cd5 100644 --- a/grails-spring/build.gradle +++ b/grails-spring/build.gradle @@ -56,9 +56,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-test-suite-persistence/build.gradle b/grails-test-suite-persistence/build.gradle index 1b439aec939..bb34da302ad 100644 --- a/grails-test-suite-persistence/build.gradle +++ b/grails-test-suite-persistence/build.gradle @@ -83,9 +83,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-test-suite-uber/build.gradle b/grails-test-suite-uber/build.gradle index fb46ebb7cb9..ceabfc62187 100644 --- a/grails-test-suite-uber/build.gradle +++ b/grails-test-suite-uber/build.gradle @@ -67,7 +67,7 @@ dependencies { exclude module: 'grails-rest-transforms' } testImplementation project(':grails-datamapping-validation') - testImplementation 'org.objenesis:objenesis' + testImplementation 'org.spockframework:spock-core' testCompileOnly 'jakarta.servlet:jakarta.servlet-api' testCompileOnly 'org.springframework:spring-test', { @@ -80,12 +80,6 @@ dependencies { testRuntimeOnly 'org.aspectj:aspectjweaver' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' testRuntimeOnly 'org.springframework:spring-aspects' - - // Testing - testImplementation 'org.spockframework:spock-core' - - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' } def isolatedTestPatterns = [ diff --git a/grails-testing-support-core/build.gradle b/grails-testing-support-core/build.gradle index c77fa7a5c7b..03c49d7fe2a 100644 --- a/grails-testing-support-core/build.gradle +++ b/grails-testing-support-core/build.gradle @@ -70,9 +70,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-url-mappings/build.gradle b/grails-url-mappings/build.gradle index 1e99fe688ac..288e426f5b1 100644 --- a/grails-url-mappings/build.gradle +++ b/grails-url-mappings/build.gradle @@ -64,9 +64,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-validation/build.gradle b/grails-validation/build.gradle index a247e72d288..34de5ad14b5 100644 --- a/grails-validation/build.gradle +++ b/grails-validation/build.gradle @@ -61,10 +61,9 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' + + testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's mocking support } apply { diff --git a/grails-views-gson/build.gradle b/grails-views-gson/build.gradle index 95df3ef1653..3f151a10134 100644 --- a/grails-views-gson/build.gradle +++ b/grails-views-gson/build.gradle @@ -57,6 +57,7 @@ dependencies { testImplementation 'tools.jackson.core:jackson-databind' testImplementation 'jakarta.servlet:jakarta.servlet-api' + testRuntimeOnly 'org.objenesis:objenesis' // Required by Spock for mocking classes without default constructor testRuntimeOnly 'org.slf4j:slf4j-nop' // Get rid of warning about missing slf4j implementation during test task } diff --git a/grails-web-boot/build.gradle b/grails-web-boot/build.gradle index 08e8459ed8b..e1030482dea 100644 --- a/grails-web-boot/build.gradle +++ b/grails-web-boot/build.gradle @@ -66,9 +66,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-web-common/build.gradle b/grails-web-common/build.gradle index 609140b058c..c4160ef34fc 100644 --- a/grails-web-common/build.gradle +++ b/grails-web-common/build.gradle @@ -76,9 +76,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-web-core/build.gradle b/grails-web-core/build.gradle index edc15d2743f..425f0271546 100644 --- a/grails-web-core/build.gradle +++ b/grails-web-core/build.gradle @@ -70,9 +70,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-web-databinding/build.gradle b/grails-web-databinding/build.gradle index f9e265d5039..9102a09781c 100644 --- a/grails-web-databinding/build.gradle +++ b/grails-web-databinding/build.gradle @@ -73,9 +73,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } diff --git a/grails-web-mvc/build.gradle b/grails-web-mvc/build.gradle index 085d91888a0..d93fcb0e645 100644 --- a/grails-web-mvc/build.gradle +++ b/grails-web-mvc/build.gradle @@ -62,9 +62,7 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' testImplementation 'org.spockframework:spock-core' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' + testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-web-url-mappings/build.gradle b/grails-web-url-mappings/build.gradle index 6e980c7e485..cc2d5387808 100644 --- a/grails-web-url-mappings/build.gradle +++ b/grails-web-url-mappings/build.gradle @@ -77,9 +77,6 @@ dependencies { // Testing testImplementation 'org.apache.grails:grails-controllers' // @Controller testImplementation 'org.slf4j:slf4j-simple' - // Required by Spock's Mocking - testRuntimeOnly 'net.bytebuddy:byte-buddy' - testImplementation 'org.objenesis:objenesis' testImplementation 'org.spockframework:spock-core' } From ace3695e6a30304ae82c9b18c251e5b99276592f Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Sat, 6 Jun 2026 21:35:10 +0200 Subject: [PATCH 6/7] cleanup(deps): Cleanup and document test dependencies --- grails-controllers/build.gradle | 1 - grails-converters/build.gradle | 2 +- grails-web-mvc/build.gradle | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/grails-controllers/build.gradle b/grails-controllers/build.gradle index 624e25bd546..0640d739597 100644 --- a/grails-controllers/build.gradle +++ b/grails-controllers/build.gradle @@ -77,7 +77,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' testImplementation 'org.spockframework:spock-core' - testImplementation 'org.spockframework:spock-core' } apply { diff --git a/grails-converters/build.gradle b/grails-converters/build.gradle index 1a4033376eb..1e08d1c9f80 100644 --- a/grails-converters/build.gradle +++ b/grails-converters/build.gradle @@ -73,7 +73,7 @@ dependencies { testImplementation 'org.slf4j:slf4j-simple' testImplementation 'org.spockframework:spock-core' - testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's Mocking + testRuntimeOnly 'net.bytebuddy:byte-buddy' // Required by Spock's mocking support } apply { diff --git a/grails-web-mvc/build.gradle b/grails-web-mvc/build.gradle index d93fcb0e645..2879532b7fa 100644 --- a/grails-web-mvc/build.gradle +++ b/grails-web-mvc/build.gradle @@ -62,7 +62,6 @@ dependencies { // Testing testImplementation 'org.slf4j:slf4j-simple' testImplementation 'org.spockframework:spock-core' - testImplementation 'org.spockframework:spock-core' } apply { From 4b431ee798f6b6245b5d610e3ef0e1cd42653bb1 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 9 Jun 2026 12:18:55 +0200 Subject: [PATCH 7/7] build(forge): enforce spock-2.4 `micronaut-test-bom` brings in `spock-2.3` so we override by adding `spock-bom:2.4`. --- grails-forge/grails-forge-cli/build.gradle | 1 + grails-forge/test-core/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/grails-forge/grails-forge-cli/build.gradle b/grails-forge/grails-forge-cli/build.gradle index 3d7481cb821..86fda42e8af 100644 --- a/grails-forge/grails-forge-cli/build.gradle +++ b/grails-forge/grails-forge-cli/build.gradle @@ -96,6 +96,7 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305' + testImplementation enforcedPlatform('org.spockframework:spock-bom:2.4-groovy-4.0') testImplementation 'io.micronaut.picocli:micronaut-picocli' testImplementation "org.reflections:reflections:$reflectionsVersion" testImplementation "org.testcontainers:spock" diff --git a/grails-forge/test-core/build.gradle b/grails-forge/test-core/build.gradle index adcb99ddd42..70fad3183b5 100644 --- a/grails-forge/test-core/build.gradle +++ b/grails-forge/test-core/build.gradle @@ -48,11 +48,11 @@ configurations.configureEach { dependencies { implementation gradleTestKit() implementation platform("io.micronaut.platform:micronaut-platform:$micronautVersion") - testImplementation platform("io.micronaut.platform:micronaut-platform:$micronautVersion") generateConfig "info.picocli:picocli-codegen:$picocliVersion" implementation 'io.micronaut:micronaut-inject-groovy' + testImplementation enforcedPlatform('org.spockframework:spock-bom:2.4-groovy-4.0') testImplementation project(':grails-forge-cli') testImplementation project(':grails-forge-core') testImplementation "ch.qos.logback:logback-classic"