matrei commented on PR #15703:
URL: https://github.com/apache/grails-core/pull/15703#issuecomment-4623303535

   > **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.
   
   Yes, it seems GeantyRef code was previously vendored by Spock, but is now 
using the upstream library instead:
   https://github.com/spockframework/spock/pull/1743
   
   It seems we are not consistent in excluding transitive dependencies from 
Spock (see `grails-async-core` for example).
   I actually don't think it's needed to exclude Spock transitives as we are 
declaring our own dependency on Groovy and get the version from the bom.
   On the joint workflow we switch the version in the bom and it is picked up 
as it should even without excluding Spock transitives: 
https://develocity.apache.org/s/iasnjafc4pxlo/dependencies?toggled=W1s0XSxbNCwxNF0sWzQsMTQsWzE3NjddXV0


-- 
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