Gradle application plugin defaultJvmArgs are not escaped correctly

The applicationDefaultJvmArgs values are not escaped properly. I wanted to use a system-environment called PORT, but when i add the following to my build-script,

applicationDefaultJvmArgs = ['-Ddw.server.applicationConnectors[0].port=$PORT']

it is compiled into a shell script with this value:


While what I wanted was without the escaping character like this:


A workaround is to use the WEBAPP_OPTS, but I would really like to keep the config as simple as possible.

I have also asked about this on stackoverflow with a comment from Peter Niederwieser here:

Probably a duplicate of ,

reported in GRADLE-3084