-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NoClassDefFoundError: Unable to load class groovy.util.OptionAccessor due to missing dependency Lorg/apache/commons/cli/CommandLine #2
Comments
Thanks for the report! It is most likely that I simply haven't added the provider for the command line stuff to the classpath the script is started with when you use the wrapper. I'm expecting a few of those issues since the way the wrapper is put together is extremely barebones. When you launch Groovy normally (or Gradle) you get a bunch more stuff on the classpath automatically. I appreciate the script example! Should be an easy fix, will dig around :-) |
Fixed :-) Pull the latest or download at https://github.com/MovingBlocks/groovy-wrapper/releases/tag/v1.0.2 Let me know if it works - I copy pasted your example into a script locally and got it working by adding That's a way off though and I want this to be useful :-) Am actually surprised somebody else found it so relatively quickly, how'd you find it? For more rare dependencies (and things not shipped with Gradle) it probably makes sense to use
|
Thank you, my script works now. I just thought it should work by default since I was using I found your groovy-wrapper as I was looking for a way to execute a groovy script on a windows machine where there is no groovy installed (but gradlew existed already in the code base). Actually I found another groovy-wrapper first, but this blends in better. 😁 |
Glad it worked out! Both the fix and the utility. Cool to know there is in fact another Groovy Wrapper out there, I thought it would be weird to have nothing. I do like the sneaky free ride this one gets via the Gradle Wrapper :D |
It's no longer included in the current gradle distribution. Breaks support for issue MovingBlocks#2.
When I start a script (
./groovyw script.groovy
) which is usinggroovy.util.CliBuilder
I get this exception:It works when I use
groovy script.groovy
.script.groovy:
Is it a bug or am I using it wrong?
The text was updated successfully, but these errors were encountered: