App Engine Gradle Plugin Tasks and Properties

After the App Engine Gradle plugin isadded to your project,you can use the following App Engine-specific Gradle tasks:

TaskDescription
tasksDisplays help information on installed tasks.
appengineStageGenerates an application directory for deployment.
appengineDeployStages and deploys an application to App Engine.
appengineDeployCronDeploys acron.yaml configuration file to App Engine.
appengineDeployDispatchDeploys adispatch.yaml configuration file to App Engine.
appengineDeployDosDeploys ados.yaml configuration file to App Engine.
appengineDeployIndexDeploys anindex.yaml configuration file to App Engine.
appengineDeployQueueDeploys aqueue.yaml configuration file to App Engine.
jettyRun Runs the development server using Jetty's default configurations. To find out more about theGretty plugin, seeGretty Configuration andGretty Tasks

To see a list of all the tasks:

gradletasks

For more information on how to set up and use Gradle, seeUsingApp Engine Gradle and theapp-gradle-plugin repository on GitHub.

Task properties

The contents of thegradle.build file are a set of rules to describe yourbuild. It's written in a domain specific language for describing builds, basedon theGroovy language.

Each task has associated properties below that you can use. You can specifythese properties in thegradle.build file using aconfiguration closure,task, and properties.

In this example:

  • The configuration closure for the plugin isappengine.
  • The task isdeploy.
  • The properties,stopPreviousVersion andpromote, are set totrue.
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 singleline:

appengine.deploy.stopPreviousVersion=true

See the following sections for a list of the properties that are available foreach task.

appengineStage

task(stage)

Generates an application directory for deployment. Used by theappengineDeploytask and thejettyRun task.

You can use the following properties:

PropertyDescription
artifact Built artifact that has all of the classes, resources, and manifests. Default isbuild/libs/[YOUR_SERVLET].war.
appEngineDirectory Location of theapp.yaml file. Default issrc/main/appengine.
dockerDirectory Location of theDockerfile. Default issrc/main/docker.
stagingDirectory Required. The directory to which to stage the application. Default isbuild/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 specifythese properties in thegradle.build file using aconfiguration closure,task, and properties.

In the following example:

  • The configuration closure for the plugin isappengine.
  • The task isrun.
  • The property,port, is set to8080.
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 singleline:

appengine.run.port=8888
PropertyDescription
appEngineDirectory Location of.yaml configuration files (cron, index, etc) from which configuration specific deployments (appengineDeployCron, etc) will deploy from. For flexible applications, this defaults tosrc/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 theapp.yaml file in the staging directory. If that is not found, attempts to automatically generate necessary configuration files (such asapp.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 wheninitializing the gcloud tool. To verify, usegcloud 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

PropertyDescription
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 withgcloud components install app-engine-java.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.