How to Run Groovy test cases with Groovy Jar

Assume that you have a groovy file (test.groovy) and you want to run it with Groovy jar. Follow the below steps to do it.

Here is the test.groovy file

println "test"

Then download the groovy.jar, If you don’t have it.

curl -s -L -o groovy.jar \

Then run the test file with the below command.

  java -cp groovy.jar groovy.lang.GroovyShell test.groovy