Groovy -jar

Per Nyfelt <[email protected]> Sat, 22 Feb 2025 21:34:10 +0100
Newsgroups gmane.comp.lang.groovy.user
Organization Alipsa HB
Message-ID <[email protected]>
Hi,

I find myself missing  a way to execute groovy jars e.g: `groovy -jar 
someapp.jar`.  As a workaround i can do something like the following in 
bash (error handling etc. omitted)

#!/usr/bin/env bash # takes a single parameter (the path to the jar file 
to execute - it assumes the Main-Class attribute has been set) jarName="$1" mainClass=$(unzip -p"$jarName" "META-INF/MANIFEST.MF" |grep 'Main-Class:' |awk '{ print $2 }' |tr -d'\r') java -cp $jarName:$GROOVY_HOME/lib/* $mainClass

But it would be nice to support this "natively" in groovy with `groovy -jar`

Has support for this been discussed before?

Best regards,

Per