Instead of environment variables, like myProperty, please use Gradle properties they can be specified in the gradle.properties file, if not secret. For more vulnerable data or properties that may change when running tasks, you can set such properties using environment variables prefixed with ORG_GRADLE_PROJECT_ example: ORG_GRADLE_PROJECT_myProperty