Summary
The CI - Groovy Joint Validation Build workflow (build_grails job) has been failing on every push to 8.0.x since 2026-04-29 with a Spock vs. Groovy major-version mismatch:
> Task :grails-test-examples-issue-11767:compileIntegrationTestGroovy
startup failed:
Could not instantiate global transform class
org.spockframework.compiler.SpockTransform specified at
jar:file:.../spock-core/2.4-groovy-5.0/.../spock-core-2.4-groovy-5.0.jar!/META-INF/services/...
because of exception
org.spockframework.util.IncompatibleGroovyVersionException:
The Spock compiler plugin cannot execute because Spock 2.4.0-groovy-5.0
is not compatible with Groovy 4.0.32-SNAPSHOT.
Spock artifact: file:.../spock-core-2.4-groovy-5.0.jar
Groovy artifact: file:.../groovy-4.0.32-SNAPSHOT.jar
> Task :grails-test-examples-issue-11767:compileIntegrationTestGroovy FAILED
> Task :grails-test-examples-micronaut:compileIntegrationTestGroovy FAILED
Affected runs (10 most recent 8.0.x runs of the workflow)
The same failure is reproduced on every PR that merges latest 8.0.x (e.g. PR #15467 / run 25170545059).
Root cause
Commit ae7ee513ec (Override spock to match the micronaut bom's version) bumped the Spock artifact to spock-core:2.4-groovy-5.0 because the Micronaut BOM moved to Groovy 5. spock-core:2.4-groovy-5.0 ships an AST-transform with a hard-coded major-version check that rejects Groovy 4.x at compile time.
The Joint Validation Build (.github/workflows/groovy-joint-workflow.yml) deliberately swaps the Groovy artifact to the Apache Groovy 4.x main snapshot (currently 4.0.32-SNAPSHOT) so we catch breakages before Groovy ships them. With the Spock-5 artifact pinned in the BOM, every Spock spec compiled in the joint build now fails the version check.
Existing precedent
Commit 5d71eb4035 (fix(forge): bypass Spock Groovy-version check in generated app build.gradle) already adopted Spock's documented escape hatch for forge-generated apps:
tasks.withType(GroovyCompile).configureEach {
options.forkOptions.jvmArgs = (options.forkOptions.jvmArgs ?: []) +
['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}
tasks.withType(Test).configureEach {
systemProperty 'spock.iKnowWhatImDoing.disableGroovyVersionCheck', 'true'
}
The same workaround was not applied to the grails-core build itself. grep -r 'disableGroovyVersionCheck' origin/8.0.x returns nothing on the framework build files - only the rocker template carries it.
Suggested options (please pick one)
- Apply the existing forge bypass to the framework build. Add
-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true to the shared compile/test conventions used by the test-examples and the grails-core integration-test compile classpaths (gradle/test-config.gradle, build-logic/.../CompilePlugin.groovy). Lowest-risk: matches what the forge templates already do, restores the joint build immediately.
- Publish or pin a Groovy-4-compatible Spock alongside the Groovy-5 one. Use a Gradle resolution rule (or a
spock.version override) so when groovy.version resolves to 4.x the dependency picks spock-core:2.3-groovy-4.0 (already on the classpath) instead of 2.4-groovy-5.0. Keeps the framework on a sanctioned Spock build for the Joint matrix; requires more BOM logic.
- Drop the Joint Groovy 4 matrix. If the project is consciously moving to Groovy 5 for 8.0.x, retire the joint validation against
apache/groovy:GROOVY_4_0_X and validate against the 5.x main only.
Repro
./gradlew :grails-test-examples-issue-11767:compileIntegrationTestGroovy
with the local Maven repo populated by mvn install -P -groovydoc,jaxb,asciidoctor,nodoc -DskipTests from the apache/groovy 4.0.x branch (mirroring what the workflow does).
Related
cc @jamesfredley @jdaugherty
Summary
The
CI - Groovy Joint Validation Buildworkflow (build_grailsjob) has been failing on every push to8.0.xsince 2026-04-29 with a Spock vs. Groovy major-version mismatch:Affected runs (10 most recent
8.0.xruns of the workflow)The same failure is reproduced on every PR that merges latest
8.0.x(e.g. PR #15467 / run 25170545059).Root cause
Commit ae7ee513ec (
Override spock to match the micronaut bom's version) bumped the Spock artifact tospock-core:2.4-groovy-5.0because the Micronaut BOM moved to Groovy 5.spock-core:2.4-groovy-5.0ships an AST-transform with a hard-coded major-version check that rejects Groovy 4.x at compile time.The Joint Validation Build (
.github/workflows/groovy-joint-workflow.yml) deliberately swaps the Groovy artifact to the Apache Groovy 4.x main snapshot (currently4.0.32-SNAPSHOT) so we catch breakages before Groovy ships them. With the Spock-5 artifact pinned in the BOM, every Spock spec compiled in the joint build now fails the version check.Existing precedent
Commit 5d71eb4035 (
fix(forge): bypass Spock Groovy-version check in generated app build.gradle) already adopted Spock's documented escape hatch for forge-generated apps:The same workaround was not applied to the grails-core build itself.
grep -r 'disableGroovyVersionCheck' origin/8.0.xreturns nothing on the framework build files - only the rocker template carries it.Suggested options (please pick one)
-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=trueto the shared compile/test conventions used by the test-examples and the grails-core integration-test compile classpaths (gradle/test-config.gradle,build-logic/.../CompilePlugin.groovy). Lowest-risk: matches what the forge templates already do, restores the joint build immediately.spock.versionoverride) so whengroovy.versionresolves to 4.x the dependency picksspock-core:2.3-groovy-4.0(already on the classpath) instead of2.4-groovy-5.0. Keeps the framework on a sanctioned Spock build for the Joint matrix; requires more BOM logic.apache/groovy:GROOVY_4_0_Xand validate against the 5.x main only.Repro
with the local Maven repo populated by
mvn install -P -groovydoc,jaxb,asciidoctor,nodoc -DskipTestsfrom theapache/groovy4.0.x branch (mirroring what the workflow does).Related
apache/grails-core#15467(PR currently bouncing off this failure)IncompatibleGroovyVersionExceptionrationale)cc @jamesfredley @jdaugherty