Setting a system property in Gradle

‹ What is Groovy? | Upgrading Gradle to the latest version on Ubuntu ›

Java system properties can be specified in Gradle by creating a file in one of these locations:

  • $HOME/.gradle/gradle.properties
  • $MAIN_PROJECT_DIR/gradle.properties

And creating a property name that's prefixed with systemProp. For example, to set a system property called appengine.sdk.root, you'd create a gradle.properties file with this contents:

systemProp.appengine.sdk.root=/path/to/your/appengine-java-sdk

Putting the file in $SUBPROJECT_DIR/gradle.properties does not appear to work.

Subscribe to All Posts - Wesley Tanaka