App Engine Maven Plugin Goals and Parameters

After youadd the gcloud CLI-based App Engine Maven plugin to your project, the following App Engine-specific Maven goals are available:

GoalDescription
appengine:cloudSdkLoginSets the global gcloud CLI state foraccount.
appengine:deployStages and deploys an application to App Engine.
appengine:deployAllStages and deploys an application with all of its valid yaml configurations simultaneously to App Engine.
appengine:deployCronStages and deploys acron.yaml configuration file to App Engine.
appengine:deployDispatchStages and deploys adispatch.yaml configuration file to App Engine.
appengine:deployDosStages and deploys ados.yaml configuration file to App Engine.
appengine:deployIndexStages and deploys anindex.yaml configuration file to App Engine.
appengine:deployQueueStages and deploys aqueue.yaml configuration file to App Engine.
appengine:helpDisplays help information on the App Engine Maven plugin.
appengine:run Runs the App Engine development server. When the server is running, it continuously checks to determine whetherappengine-web.xml has changed. If it has, the server reloads the application. You do not need to stop and restart your application because of changes toappengine-web.xml. This goal is supported for the legacy bundled services.
appengine:stageGenerates an application directory for deployment.
appengine:start Starts running the App Engine devserver asynchronously and then returns to the command line. When this goal runs, the behavior is the same as therun goal except that Maven continues processing goals and exits after the server is up and running. This goal is supported for the legacy bundled services.
appengine:stopStops a running App Engine web development server. This goal is supported for the legacy bundled services.
Note: The goalsappengine:run,appengine:start, andappengine:stop only apply to apps that use the legacy bundled services and deploy with anappengine-web.xml file in the standard environment.

For more information on how to set up and use Maven, seeUsing Maven.

Using parameters

Each goal has associated parameters that you can specify in thepom.xml file.For example:

<plugins><plugin><groupId>com.google.cloud.tools</groupId><artifactId>appengine-maven-plugin</artifactId><version>2.8.1</version><configuration><deploy.stopPreviousVersion>true</deploy.stopPreviousVersion><cloudSdkHome>/usr/foo/path/to/cloudsdk</cloudSdkHome></configuration></plugin></plugins>
Note: The parameter prefixes, such asdevserver, are optional. You canadd<port>8080</port> instead of<devserver.port>8080</devserver.port>.

You can also define configuration parameters in the command line, following thepattern-D[USER_PROPERTY]=[PARAMETER_VALUE].

For example, to specify a directory to which to stage your application:

mvnappengine:stage-Dapp.stage.stagingDirectory=[YOUR_STAGING_DIRECTORY]

See the following sections for a list of the parameters that are available foreach goal.

appengine:deploy

Stages and deploys an application to App Engine.

You can use the following parameters, some of which correspond togcloud app deploy command line flags orgcloud app services command line flags:

ParameterDescriptionUser Property
appEngineDirectoryThe directory that containsapp.yaml and other supported App Engine configuration files. Default is${basedir}/src/main/appengine.app.stage.appEngineDirectory
artifactThe location of the JAR or WAR archive to deploy. Default is${project.build.directory}/${project.build.finalName}.${project.packaging}.app.stage.artifact
bucketThe Cloud Storage bucket used to stage files associated with the deployment. If this argument is not specified, the application's default bucket is used.app.deploy.bucket
cloudSdkPathOptional parameter to configure the location of the Google Cloud CLI. Default is to automatically discover from the PATH or standard install location.cloudSdkPath
deployablesThe 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.app.deploy.deployables
dockerDirectoryThe directory containing the Dockerfile and other Docker resources. Default is${basedir}/src/main/docker/.app.stage.dockerDirectory
imageUrlDeploy with a specific Docker image.ImageUrl must be a valid Artifact Registry name, for example,docker.pkg.dev/foo, wherefoo is the name of the image.app.deploy.imageUrl
projectIdThe Google Cloud project name to use for this invocation. Default is the current project selected wheninitializinggcloud.app.deploy.projectId
promotePromote the deployed version to receive all traffic. Default isTrue.app.deploy.promote
serverThe App Engine server to connect to. Typically, you do not need to change this value.app.deploy.server
stagingDirectoryRequired. The directory to which to stage the application. Default is${project.build.directory}/appengine-staging.app.stage.stagingDirectory
stopPreviousVersionStop the previously running version when deploying a new version that receives all traffic.app.deploy.stopPreviousVersion
versionThe 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.app.deploy.version

appengine:help

Displays help information on the App Engine Maven plugin. To displayparameter details, call:

mvnappengine:help-Ddetail=true-Dgoal=[GOAL_NAME]

You can use the following parameters:

ParameterDescriptionUser Property
detailIf true, display all settable properties for each goal. Default isFalse.detail
goalThe name of the goal for which to show help. If unspecified, all goals will be displayed.goal
indentSizeThe number of spaces per indentation level. Should be a positive number. Default is2.indentSize
lineLengthThe maximum length of a display line. Should be a positive number. Default is80.lineLength

appengine:stage

Generates an application build directory for deployment.

You can use the following parameters:

ParameterDescriptionUser Property
appEngineDirectoryThe directory that containsapp.yaml and other supported App Engine configuration files. Default is${basedir}/src/main/appengine.app.stage.appEngineDirectory
artifactThe location of the JAR or WAR archive to deploy. Default is${project.build.directory}/${project.build.finalName}.${project.packaging}.app.stage.artifact
cloudSdkPathOptional parameter to configure the location of the gcloud CLI.cloudSdkPath
dockerDirectoryThe directory containing the Dockerfile and other Docker resources. Default is${basedir}/src/main/docker/${basedir}/src/main/docker/.app.stage.dockerDirectory
stagingDirectoryRequired. The directory to which to stage the application. Default is${project.build.directory}/appengine-stagingapp.stage.stagingDirectory

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.