jamesfredley commented on PR #15703:
URL: https://github.com/apache/grails-core/pull/15703#issuecomment-4622975227
**Re: the new `geantyref` dependency**
Spock 2.4 externalized its bundled gentyref into
`io.leangen.geantyref:geantyref:1.3.16` and declares it as a **required
`runtime` dependency** of `spock-core` (used by the mock engine's
`GenericTypeReflectorUtil`). Without it, `Mock()`/`Stub()`/`Spy()` fail at
runtime with `NoClassDefFoundError: io/leangen/geantyref/GenericTypeReflector`.
The reason it has to be added in ~34 modules is our existing `spock-core {
transitive = false }`, which strips *all* of Spock's transitives
(groovy/junit/hamcrest/geantyref) on purpose - to keep Spock from pinning the
Groovy/JUnit versions, which matters for the Groovy joint-validation build. So
`geantyref` is just the first *required* Spock dep that isolation removes.
Note it's different from `byte-buddy`/`objenesis`: those aren't in Spock's
POM at all (optional, delivered via Gradle module metadata), so they'd never
come transitively regardless - that's why they were always declared by hand.
`geantyref` *is* a required POM dep, so it only needs re-adding because of
`transitive = false`. Modules that take Spock transitively (e.g. grails-forge,
which only excludes `groovy-all`) get it automatically and need no change.
Alternative considered: swapping `transitive = false` for a targeted
`exclude group: 'org.apache.groovy'` would let `geantyref` flow in by itself,
but that changes a long-standing pattern across 34 modules and pulls Spock's
junit/hamcrest back in - better as a separate cleanup than part of this Spock
bump.
--
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]