[
https://issues.apache.org/jira/browse/GROOVY-9404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles closed GROOVY-9404.
-------------------------------
Resolution: Information Provided
> NoClassDefFoundError: picocli/CommandLine$ParameterException in scripts after
> update to Groovy 3.0.0
> ----------------------------------------------------------------------------------------------------
>
> Key: GROOVY-9404
> URL: https://issues.apache.org/jira/browse/GROOVY-9404
> Project: Groovy
> Issue Type: Bug
> Components: command line processing
> Affects Versions: 3.0.0
> Environment: Linux
> Reporter: Dirk Heinrichs
> Priority: Major
>
> After update from Groovy 2.5.x to 3.0.0, scripts using picocli are failing
> with the following error:
> {code:java}
> NoClassDefFoundError: picocli/CommandLine$ParameterException{code}
> Here's a small example showing the problem:
> {code:java}
> import groovy.cli.picocli.CliBuilder
> def cli = new CliBuilder(name: 'cliTest.groovy')
> cli.h(type: Boolean, longOpt: 'help', usageHelp: true, required: false, 'Show
> usage information')
> cli.c(type: String, longOpt: 'config', required: true, args: 1, 'Path to
> config file (required)')
> def opts = cli.parse(args)
> opts || System.exit(1)
> if(opts.h) {
> cli.usage()
> System.exit(0)
> }
> println(opts.c)
> {code}
> Running this with Groovy 2.5.7 works:
> {code:java}
> % ~/tmp/groovy-2.5.7/bin/groovy ./cliTest.groovy -c data/config_prod.yaml
> data/config_prod.yaml{code}
> But with 3.0.0, it does not:
> {code:java}
> % ~/tmp/groovy-3.0.0/bin/groovy ./cliTest.groovy -c data/config_prod.yaml
> Caught: java.lang.NoClassDefFoundError: picocli/CommandLine$ParameterException
> java.lang.NoClassDefFoundError: picocli/CommandLine$ParameterException
> at cliTest.run(cliTest.groovy:4)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> Caused by: java.lang.ClassNotFoundException:
> picocli.CommandLine$ParameterException
> ... 4 more{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)