The contents of the gradle.build file are a set of rules to describe your
build. It's written in a domain specific language for describing builds, based
on the
Groovy language.
Each task has associated properties below that you can use. You can specify
these properties in the gradle.build file using a
configuration closure,
task, and properties.
In this example:
The configuration closure for the plugin is appengine.
The task is deploy.
The properties, stopPreviousVersion and promote, are set to true.
appengine{deploy{// deploy configurationstopPreviousVersion=true// default - stop the current versionpromote=true// default - & make this the current version}}
If you only have a to specify a few properties, you can set them in a single
line:
appengine.deploy.stopPreviousVersion=true
See the following sections for a list of the properties that are available for
each task.
appengineStage
task(stage)
Generates an application directory for deployment. Used by the appengineDeploy
task and the jettyRun task.
You can use the following properties:
Property
Description
artifact
Built artifact that has all of the classes, resources, and manifests.
Default is build/libs/[YOUR_SERVLET].war.
appEngineDirectory
Location of the app.yaml file. Default is
src/main/appengine.
dockerDirectory
Location of the Dockerfile. Default is
src/main/docker.
stagingDirectory
Required. The directory to which to stage the application. Default is
build/staged-app.
appengineDeploy
task(deploy)
Stages and deploys an application to App Engine.
Each task has associated properties below that you can use. You can specify
these properties in the gradle.build file using a
configuration closure,
task, and properties.
In the following example:
The configuration closure for the plugin is appengine.
The task is run.
The property, port, is set to 8080.
appengine{// App Engine tasks configurationrun{// local (dev_appserver) configuration (standard environments only)port=8080// default}deploy{// deploy configurationstopPreviousVersion=true// default - stop the current versionpromote=true// default - & make this the current version}}
If you only have a to specify a few properties, you can set them in a single
line:
appengine.run.port=8888
Property
Description
appEngineDirectory
Location of .yaml configuration files (cron, index, etc) from
which configuration specific deployments (appengineDeployCron, etc) will
deploy from. For flexible applications, this defaults to
src/main/appengine.
bucket
The Cloud Storage bucket used to stage files associated with the
deployment. If this argument is not specified, the application's default
bucket is used.
deployables
The YAML files for the services or configurations you want to deploy.
Default is the app.yaml file in the staging directory. If
that is not found, attempts to automatically generate necessary
configuration files (such as app.yaml) in the staging
directory.
imageUrl
Deploy with a specific Docker image. Docker URL must be from one of the
valid Artifact Registry hostnames.
project
The Google Cloud Platform project name to use for this invocation.
Default is the current project selected when
initializing the gcloud tool. To verify,
use gcloud config list project.
promote
Promote the deployed version to receive all traffic. Default is True.
server
The App Engine server to connect to. Typically, you do not need to change
this value.
stopPreviousVersion
Stop the previously running version when deploying a new version that
receives all traffic.
version
The version of the app that will be created or replaced by this
deployment. If you do not specify a version, one will be generated for
you.
Global properties
Property
Description
tools.cloudSdkHome
Optional property to configure the location of the Google Cloud CLI.
Typically the plugin finds this in the gcloud CLI when it is installed with
gcloud components install app-engine-java.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[[["\u003cp\u003eThe App Engine Gradle plugin provides various tasks for managing and deploying applications, including \u003ccode\u003eappengineStage\u003c/code\u003e, \u003ccode\u003eappengineDeploy\u003c/code\u003e, and others for deploying specific configuration files like \u003ccode\u003ecron.yaml\u003c/code\u003e, \u003ccode\u003edispatch.yaml\u003c/code\u003e, etc.\u003c/p\u003e\n"],["\u003cp\u003eEach task within the App Engine Gradle plugin has configurable properties, which can be set in the \u003ccode\u003egradle.build\u003c/code\u003e file using a configuration closure (e.g., \u003ccode\u003eappengine\u003c/code\u003e) or directly in a single line, like setting \u003ccode\u003eappengine.deploy.stopPreviousVersion = true\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eappengineStage\u003c/code\u003e task generates an application directory for deployment, with configurable properties such as \u003ccode\u003eartifact\u003c/code\u003e, \u003ccode\u003eappEngineDirectory\u003c/code\u003e, \u003ccode\u003edockerDirectory\u003c/code\u003e, and \u003ccode\u003estagingDirectory\u003c/code\u003e, with \u003ccode\u003ebuild/staged-app\u003c/code\u003e being the default for \u003ccode\u003estagingDirectory\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eappengineDeploy\u003c/code\u003e task stages and deploys applications to App Engine, and allows customization of the deployment through various properties, such as \u003ccode\u003epromote\u003c/code\u003e, \u003ccode\u003estopPreviousVersion\u003c/code\u003e, and \u003ccode\u003ebucket\u003c/code\u003e, which dictate the behavior of the deployment.\u003c/p\u003e\n"],["\u003cp\u003eYou can use \u003ccode\u003egradle tasks\u003c/code\u003e to see a complete list of all available tasks within the plugin.\u003c/p\u003e\n"]]],[],null,["# App Engine Gradle Plugin Tasks and Properties\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nAfter the App Engine Gradle plugin is [added to your project](/appengine/docs/standard/java-gen2/using-gradle#creating_a_new_project),\nyou can use the following App Engine-specific Gradle tasks:\n\nTo see a list of all the tasks: \n\n gradle tasks\n\nFor more information on how to set up and use Gradle, see\n\n[Using\nApp Engine Gradle](/appengine/docs/standard/java-gen2/using-gradle)\nand the\n[`app-gradle-plugin`](https://github.com/GoogleCloudPlatform/app-gradle-plugin)\nrepository on GitHub.\n\nTask properties\n---------------\n\nThe contents of the `gradle.build` file are a set of rules to describe your\nbuild. It's written in a domain specific language for describing builds, based\non the\n[Groovy language](http://www.groovy-lang.org/).\n\nEach task has associated properties below that you can use. You can specify\nthese properties in the `gradle.build` file using a\n[configuration closure](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:getting_input_from_the_build),\ntask, and properties.\n\nIn this example:\n\n- The configuration closure for the plugin is `appengine`.\n- The task is `deploy`.\n- The properties, `stopPreviousVersion` and `promote`, are set to `true`.\n\n appengine {\n deploy { // deploy configuration\n stopPreviousVersion = true // default - stop the current version\n promote = true // default - & make this the current version\n }\n }\n\nIf you only have a to specify a few properties, you can set them in a single line:\n\n\u003cbr /\u003e\n\n```java\n appengine.deploy.stopPreviousVersion = true\n```\n\nSee the following sections for a list of the properties that are available for\neach task.\n\nappengineStage\n--------------\n\n**task(stage)**\n\nGenerates an application directory for deployment. Used by the `appengineDeploy`\ntask and the `jettyRun` task.\n\nYou can use the following properties:\n\nappengineDeploy\n---------------\n\n**task(deploy)**\n\nStages and deploys an application to App Engine.\n\nEach task has associated properties below that you can use. You can specify\nthese properties in the `gradle.build` file using a\n[configuration closure](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:getting_input_from_the_build),\ntask, and properties.\n\nIn the following example:\n\n- The configuration closure for the plugin is `appengine`.\n- The task is `run`.\n- The property, `port`, is set to `8080`.\n\n appengine { // App Engine tasks configuration\n run { // local (dev_appserver) configuration (standard environments only)\n port = 8080 // default\n }\n\n deploy { // deploy configuration\n stopPreviousVersion = true // default - stop the current version\n promote = true // default - & make this the current version\n }\n }\n\nIf you only have a to specify a few properties, you can set them in a single\nline: \n\n```java\n appengine.run.port = 8888\n```\n\nGlobal properties\n-----------------"]]