You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/06/08 10:39:00 UTC

[jira] [Commented] (GROOVY-9165) Grape cannot pull in picocli

    [ https://issues.apache.org/jira/browse/GROOVY-9165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16859177#comment-16859177 ] 

Paul King commented on GROOVY-9165:
-----------------------------------

Yes, I now remember a piece of history about how we did the commons cli integration which I hadn't remembered when reviewing the picocli changes. Our internal use of commons cli avoided using CliBuilder. When making our current changes, we swapped most things over. I think we should go back and just directly interface to picocli. We already embed picocli via jarjar, so that would let users pick whichever version they want when using CliBuilder which was the intention.

There is a secondary issue which is which jars get bundled in the distribution zips which might still come into play but we can look at that as a subsequent step.

> Grape cannot pull in picocli
> ----------------------------
>
>                 Key: GROOVY-9165
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9165
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Grape, groovy-runtime
>    Affects Versions: 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.5.6, 2.5.7
>            Reporter: Remko Popma
>            Priority: Major
>
> If I try to run a Groovy script I am unable to pull in a newer version of picocli via {{@Grab}}:
> {code:groovy}
> @Grab('info.picocli:picocli-groovy:4.0.0-beta-1b')
> @GrabExclude('org.codehaus.groovy:groovy-all')
> @picocli.groovy.PicocliScript
> @picocli.CommandLine.Command
> import picocli.CommandLine
> println "Groovy version ${GroovySystem.version}"
> println "Picocli version $CommandLine.VERSION"
>  {code}
> Depending on the Groovy version, this prints 
> {code}
> Groovy version 2.5.0
> Picocli version 3.0.2
> {code}
> or 
> {code}
> Groovy version 2.5.7
> Picocli version 3.9.5
> {code}
> So the {{@Grab('info.picocli:picocli-groovy:4.0.0-beta-1b')}} is not honoured.
> This is because the {{groovy.ui.GroovyMain}} class, which executes Groovy scripts, itself uses picocli to parse the command line parameters. Unfortunately, this means that Groovy script authors cannot control the picocli version used by their scripts.
> Is there anything we can do to improve this?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)