The picocli-groovy
module should not declare org.codehaus.groovy:groovy-all
as dependency
#1933
Labels
lang: groovy
Groovy-related
theme: build
An issue or change related to the build system
theme: compatibility
Issues related to binary and source backwards compatibility
theme: integration
An issue or change related to integration with other frameworks, shells or operating systems
type: bug 🐛
Milestone
Related to #1613, and highlighted by #1874 and #1885:
From release 4.7.0, the
picocli-groovy
module hadorg.codehaus.groovy:groovy-all
as dependency.The idea was that this was necessary because the
picocli-groovy
module exports Groovy API.For example,
picocli.groovy.PicocliBaseScript2
extendsgroovy.lang.Script
.However, the
org.codehaus.groovy
Maven coordinates have been superceded byorg.apache.groovy
since Groovy 4.By requiring
org.codehaus.groovy:groovy-all
, picocli brings in an older version of Groovy (Groovy 2.4.x), on top of the version of Groovy that is being used to launch the picocli-based Groovy script.This caused the problem highlighted by #1874 and #1885:
IllegalStateException: Error registering runner class 'org.codehaus.groovy.testng.TestNgRunner'
.Since the
picocli-groovy
module is giving support for Groovy scripts, it should rely on the Groovy version in the environment where the script is run, and should not attempt to bring in its own version of Groovy.Concretely, the Groovy dependency should be reverted back to
compileOnly
fromapi
in thepicocli-groovy
Gradle build script.The text was updated successfully, but these errors were encountered: