jamesfredley opened a new pull request, #15703:
URL: https://github.com/apache/grails-core/pull/15703

   ## What
   
   Upgrades Spock and aligns test-related dependencies on the `8.0.x` branch.
   
   | Dependency | Before | After | Notes |
   |---|---|---|---|
   | `spock.version` | `2.3-groovy-4.0` | `2.4-groovy-4.0` | latest **stable** 
for Groovy 4.0 (there is no 2.5) |
   | `gradle-spock.version` | `2.3-groovy-4.0` | `2.4-groovy-4.0` | build-logic 
+ grails-gradle |
   | `selenium.version` | `4.38.0` | `4.44.0` | latest 4.x; backward compatible 
with Geb 8.0.1 |
   | `geantyref.version` | - | `1.3.16` | **new** - Spock 2.4 mocking 
dependency (see below) |
   | `grails-forge` `spockVersion` | `2.3-groovy-4.0` | `2.4-groovy-4.0` | 
branch consistency |
   
   Left unchanged on purpose:
   
   - **JUnit** (`6.0.3`) already matches Spring Boot 4.0.6's managed 
`junit-jupiter`.
   - **byte-buddy** (`1.18.8`) keeps its existing deliberate override above 
Boot's `1.17.8`.
   - **objenesis** (`3.4`) and **geb-spock** (`8.0.1`) are already at their 
latest.
   
   ## Why the new `geantyref` dependency
   
   Spock 2.4 replaced its bundled gentyref code with the 
`io.leangen.geantyref:geantyref:1.3.16` library, declared in `spock-core` as a 
**required** `runtime` dependency and used by the mocking engine 
(`GenericTypeReflectorUtil`). Spock's release notes: *"This is now a required 
dependency used by spock."*
   
   Most grails-core modules declare `spock-core` with `transitive = false` and 
re-add the mocking deps (`byte-buddy`, `objenesis`) explicitly. Those modules 
therefore also need `geantyref`, otherwise `Mock()`/`Stub()`/`Spy()` fail at 
runtime with:
   
   ```
   java.lang.NoClassDefFoundError: io/leangen/geantyref/GenericTypeReflector
   ```
   
   This PR:
   
   - adds `geantyref` to the BOM (`gradleBomDependencies`) so it is 
version-managed and flows transitively to consumers, and
   - declares it explicitly next to `byte-buddy`/`objenesis` in every framework 
module that strips Spock's transitives.
   
   ## Generated applications need no changes
   
   `grails-forge` and `grails-profiles` generate apps that declare `spock-core` 
**transitively** (plain `testImplementation "org.spockframework:spock-core"`, 
no excludes). `geantyref` therefore arrives automatically as a transitive of 
`spock-core`, pinned to `1.3.16` by the `grails-bom`. No generator or skeleton 
template changes are required.
   
   ## Verification
   
   - `./gradlew :grails-bootstrap:test` - PASSED (previously 6 
`NoClassDefFoundError` mock failures, now green)
   - `./gradlew :grails-web-mvc:test` - PASSED (`transitive = false` + mocking)
   - `./gradlew :grails-spring:test` - compiles clean
   
   CI will exercise the full module matrix, the separate `grails-gradle` build, 
and `grails-forge`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to