System Property Leakage via the Tooling API

Gradle Version: 3.1
Operating System and JVM version: Ubuntu 16.04.1, Java 8
Is this a regression? I do not think so.

Link to a minimal sample project:

I’m working on my own NetBeans plugin and I’ve experienced the following things the other day:
I thought I no longer need my Java keystore on $HOME/.keystore and removed it. Unfortunately
I set NetBeans to use that keystore using system properties. NetBeans handled the absence of the keystore gracefully, but for my surprise this an all other System properties were passed/inherited/leaked to the Gradle daemon which executed my project builds.

I do not know that this happens by design, but the thing that worries mean that I have no control over this System property leaking, which can result unintentionally different execution results between builds launced from command line and the IDE.

I could image, that someone use this behaviour of Gradle as a “feature”. I’d propose a new boolean property like ConfigurableBuildLauncher.setInheritSystemProperties(boolean b) and set it true by default for 3.x with a warning message (like we had in Ant days) and then set the default to false from 4.0.