Example for creating a Groovy stand-alone self-executable jar with gradle.
The generated jar contains the compiled groovy script, and the groovy embeddable jar.
Having this self-executable jar, you can start the groovy script, like java -jar MyScriptAsJar.jar
- Run command
gradlew uberjar
to execute the taskuberjar
- Generated jar file is at
build\libs\printer-1.0.jar
- Run command
java -jar build/libs/printer-1.0.jar -p HelloGroovy
to execute the jar