It seems that on Windows the JavaExec task does not properly handle property values that contain double-quotes. For example for the following
task runApp(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'net.rubygrapefruit.platform.test.Main'
systemProperties['json'] = '{"enabled":true}'
println getAllJvmArgs()
}
the println
still properly shows [-Djson={"enabled":true}, ...
but the class being run returns {enabled:true}
(no quotes around “enabled”) for System.getProperty("json")
.
Note that this only happens on Windows. On Linux I do not observe this behavior.