How to use @grab in groovy scripts?
Hi!
How can I extend groovy script functionality inside ReadyAPI? ReadyAPI version 3.47.0 with Groovy 3.0.14 installed.
I already added latest Apache ivy dependency manager "ivy-2.5.1.jar" to "C:\Program Files\SmartBear\ReadyAPI-3.47.0\bin\ext", but grab command is not working:
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.3')
Wed Jul 05 13:21:28 CEST 2023: ERROR: An error occurred in the script of the Groovy Script test step [Groovy Script]:
Wed Jul 05 13:21:28 CEST 2023: ERROR: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script6.groovy: 1: Unexpected input: '@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.3')' @ line 1, column 81.
oovy-wslite', version='1.1.3')
Thank you in advance!
sp00ky
Not sure why it is failing.
Alternatively, you can download the same groovy-wslite from below location and use it. of course, remove the @Grab line fom the script.
https://repo1.maven.org/maven2/com/github/groovy-wslite/groovy-wslite/1.1.3/groovy-wslite-1.1.3.jar
nmrao Thank you. It is not solving the original problem loading dependencies dynamically via @Grab, but it works. It also proves that loading jar libs from /bin/ext/ folder is working. I guess the ivy lib needs an additional lib like ant to use @Grab command but I will not investigate further.