Skip to content

The picocli-groovy module should not declare org.codehaus.groovy:groovy-all as dependency #1933

@remkop

Description

@remkop

Related to #1613, and highlighted by #1874 and #1885:

From release 4.7.0, the picocli-groovy module had org.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 extends groovy.lang.Script.

However, the org.codehaus.groovy Maven coordinates have been superceded by org.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 from api in the picocli-groovy Gradle build script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang: groovyGroovy-relatedtheme: buildAn issue or change related to the build systemtheme: compatibilityIssues related to binary and source backwards compatibilitytheme: integrationAn issue or change related to integration with other frameworks, shells or operating systemstype: bug 🐛

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions