So, to make Gradle work like the maven:
you have to do some extra magic. When Gradle forks a new process dedicated for tests it doesn’t automatically forward the original system properties. In order to achieve this, the following needs to be added:
Now you can use just do:
and the options will be applied properly.
If you have multiple test tasks, you can also do it in one stab:
For a full working example check out my fork of cucumber-java-skeleton, adding gradle support.