I’m using the distZip task in the Application plugin to build a packages java/groovy application. It includes a definition for a env var DEFAULT_JVM_OPTS which is passed to the JVM that runs the application. I want to pass some specific default arguments in this var - but I can see no way to set it. I’ve tried editing scripts/ but - of course - it’s overwritten.
What do I put in my build file to set this env var in the generated scripts ?
There is currently no built in support to define default opts in your build. but you can manipulate the generated build scripts within your buildscript to achieve your needs. You can either manipulate the generated start script file directly like in the following example:
Thanks Rene. That’s clear. I just looked at the source and see that the Unix template text is fixed. Presumably there is a similar fix for the Windows script, also?
The templates are adapted using the GroovyTemplateEngine. At the moment we do not offer a way to pass default OPTS to the template engine that are integrated in the resulting start script. you can access the windows start script via: