GRADLE-2673 applied the patch from an anonymous Joerg (not me)