# How should I be handling passing system properties from Gradle to my tests

**URL:** <https://discuss.gradle.org/t/how-should-i-be-handling-passing-system-properties-from-gradle-to-my-tests/7171>\
**Category:** Old Forum Archive\
**Created:** [May 8, 2012, 10:19pm UTC](https://discuss.gradle.org/t/how-should-i-be-handling-passing-system-properties-from-gradle-to-my-tests/7171 "2012-05-08T22:19:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [May 9, 2012, 8:59am UTC](https://discuss.gradle.org/t/how-should-i-be-handling-passing-system-properties-from-gradle-to-my-tests/7171/3 "2012-05-09T08:59:00Z")

</div>

What you are trying to do is to set system properties for the _test_ JVM(s), not the Gradle JVM. That’s why you have to add some code to propagate system properties from the latter to the former. Gradle doesn’t do that automatically because it could have adverse effects on tests. As I showed, it’s simple to propagate all system properties if desired.

Of course you can always override the task configuration rule (your first line) for selected tasks. You could potentially save some code by creating those special tasks in a loop.

---

_[View the full topic](https://discuss.gradle.org/t/how-should-i-be-handling-passing-system-properties-from-gradle-to-my-tests/7171)._
