Reputation: 3079
Equivalent to java -Dprop="abc" app
, but using groovy, like groovy -Dprop="abc" app.groovy
Basically the same question asked here, but negative answers there are relatively old. Anything new support this since 2007?
Upvotes: 5
Views: 8787
Reputation: 160211
Sure; it works as-is:
$ cat sysenv.groovy
println System.getProperty("wat")
$ groovy -Dwat="hello" sysenv.groovy
hello
Upvotes: 7