354 shows that we're running just fine with Groovy 4.x (build and test). A dependency upgrade won't have any effect, though, as long as Gradle decides for the runtime classpath of a plugin, which Groovy version to use. This is currently (Gradle 8) pinned to Groovy 3.
Relates to https://github.com/gesellix/docker-client/issues/578