Gradle build works from command line but not from jenkins

Why not just use Project.mkdir()?