App Engine Maven Plugin Goals and Parameters

After the App Engine Maven plugin is added to your project, the following App Engine-specific Maven goals are available:

Goal Description
appengine:deploy Stages and deploys an application to App Engine.
appengine:help Displays 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 whether appengine-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 to appengine-web.xml.
appengine:stage Generates 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 the run goal except that Maven continues processing goals and exits after the server is up and running.
appengine:stop Stops a running App Engine web development server.

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

Users of the Maven plugin version based on the App Engine SDK for Java can find a mapping of the previous plugin goals to gcloud commands in the related reference documentation.

Goal parameters

Each goal has associated parameters that you can use. You can specify these settings in the pom.xml or in the command line.

To configure these settings in the pom.xml, add the parameter name in the <configuration> section.

The following example splits JAR files, stops the previously running version, and specifies the Cloud SDK path:

<plugins>
   <plugin>
     <groupId>com.google.cloud.tools</groupId>
     <artifactId>appengine-maven-plugin</artifactId>
     <version>1.0.0</version>
     <configuration>
       <stage.enableJarSplitting>true</stage.enableJarSplitting>
       <deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
       <cloudSdkPath>/usr/foo/path/to/cloudsdk</cloudSdkPath>
     </configuration>
  </plugin>
</plugins>

Alternatively, to configure these settings in the command line, follow the pattern -D[USER_PROPERTY]=[PARAMETER_VALUE].

The following example specifies a directory to stage your application to:

mvn appengine:stage -Dapp.stage.stagingDirectory=[YOUR_STAGING_DIRECTORY]

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

appengine:deploy

Stages and deploys an application to App Engine.

You can use the following parameters, some of which correspond to gcloud app deploy command line flags:

gcloud app deploy --version or gcloud app deploy --v
Parameter Description User Property
bucket The Google 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
cloudSdkPath Optional parameter to configure the location of the Google Cloud SDK. cloudSdkPath
compileEncoding The character encoding to use when compiling JSPs. Applies to the App Engine standard environment only. app.stage.compileEncoding
deleteJsps Deletes the JSP source files after compilation. Applies to the App Engine standard environment only. app.stage.deleteJsps
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 notfound, attempts to automatically generate necessary configuration files (such as app.yaml) in the staging directory. app.deploy.deployables
disableJarJsps Disable adding the classes generated from JSPs. Applies to the App Engine standard environment only. app.stage.disableJarJsps
dockerBuild Perform a hosted (remote) or local (local) Docker build. To perform a local build, you must have your local docker environment configured correctly. Default is a hosted build. app.deploy.dockerBuild
dockerfile The location of the dockerfile to use for App Engine Standard applications running on the flexible environment. Applies to the App Engine standard environment only. app.stage.dockerfile
enableJarClasses Jar the WEB-INF/classes content. Applies to the App Engine standard environment only. app.stage.enableJarClasses
enableJarSplitting Split JAR files larger than 10 MB into smaller fragments. Applies to the App Engine standard environment only. app.stage.enableJarSplitting
enableQuickstart Use Jetty quickstart to process servlet annotations. Applies to the App Engine standard environment only. app.stage.enableQuickstart
force Force deploying, overriding any previous in-progress deployments to this version. app.deploy.force
imageUrl Deploy with a specific Docker image. Docker URL must be from one of the valid Google Container Registry hostnames. app.deploy.imageUrl
jarSplittingExcludes Exclude files that match the list of comma separated SUFFIXES from all JAR files. Applies to the App Engine standard environment only. app.stage.jarSplittingExcludes
project The Google Cloud Platform project name to use for this invocation. Default is the current project selected when initializing gcloud.gcloud app deploy --version or gcloud app deploy --v app.deploy.project
promote Promote the deployed version to receive all traffic. Default is True. app.deploy.promote
server The App Engine server to connect to. Typically, you do not need to change this value. app.deploy.server
sourceDirectory Required. The location of the compiled web application files, or the exploded WAR. This is used as the source for staging. Applies to the App Engine standard environment only. Default is ${project.build.directory}/${project.build.finalName}. app.stage.sourceDirectory
stagingDirectory Required. The directory to which to stage the application. Default is ${project.build.directory}/appengine-staging. app.stage.stagingDirectory
stopPreviousVersion Stop the previously running version when deploying a new version that receives all traffic. app.deploy.stopPreviousVersion
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. app.deploy.version

appengine:help

Displays help information about the App Engine Maven plugin.

To display parameter details, call:

mvn appengine:help -Ddetail=true -Dgoal=[GOAL_NAME]

You can use the following parameters:

Parameter Description User Property
detail If true, display all settable properties for each goal. Default isgcloud app deploy --version or gcloud app deploy --v False. detail
goal The name of the goal for which to show help. If unspecified, all goals will be displayed. goal
indentSize The number of spaces per indentation level. Should be a positive number. Default is 2. indentSize
lineLength The maximum length of a display line. Should be a positive number. Default is 80. lineLength

appengine:run

Runs the App Engine development web server. When the server is running, it continuously checks to determine whether appengine-web.xml has changed. If it has, the server reloads the application. This means that you do not need to stop and restart your application because of changes to appengine-web.xml.

You can use the following parameters, some of which correspond to the local development server command line flags:

Parameter Description User Property
adminHost Host name to which the admin server should bind. Default is localhost. app.devserver.adminHost
adminPort Port to which the admin server should bind. Default is 8000. app.devserver.adminPort
allowSkippedFiles Make files specified in the app.yaml skip_files or static handles readable by the application. Default is False. app.devserver.allowSkippedFiles
apiPort Port to which the server for API calls should bind. Default is 0. app.devserver.apiPort
appYamls Required. Path to a yaml file, or a directory containing yaml files, or a directory containing WEB-INF/web.xml. Default is ${project.build.directory}/ ${project.build.finalName}. app.devserver.appYamls
authDomain Name of the authorization domain to use. Default is gmail.com. app.devserver.authDomain
automaticRestart Restart instances automatically when files relevant to their service are changed. Default is True. app.devserver.automaticRestart
cloudSdkPath Optional parameter to configure the location of the Google Cloud SDK. cloudSdkPath
customEntrypoint For custom runtimes in the flexible environment, specify an entrypoint for custom runtime services. This is required when such services are present. Include [PORT] in the string to pass the port number in as an argument. For example: gunicorn -b localhost:[PORT] mymodule:application. app.devserver.customEntrypoint
defaultGcsBucketName Default Google Cloud Storage bucket name. app.devserver.defaultGcsBucketName
devAppserverLogLevel The log level below which logging messages generated by the development web server will not be displayed on the console (this flag is more useful for diagnosing problems in dev_appserver.py rather than in application code). Options are debug, info, warning, critical, and error. Default is info. app.devserver.devAppserverLogLevel
host Host name to which application services should bind. Default is localhost. app.devserver.host
jvmFlags Additional arguments to pass to the java command when launching an instance of the app. May be specified more than once. Example: -Xmx1024m -Xms256m app.devserver.jvmFlags
logLevel The log level below which logging messages generated by application code will not be displayed on the console. Options are debug, info, warning, critical, and error. Default is info. app.devserver.logLevel
maxModuleInstances The maximum number of runtime instances that can be started for a particular service. The value can be an integer, in which case all services are limited to that number of instances or a comma-separated list of module:max_instances. For example: default:5,backend:3 app.devserver.maxModuleInstances
port Lowest port to which application services should bind. Default is 8080. app.devserver.port
pythonStartupArgs The arguments made available to the script specified in devserver.pythonStartupScript. app.devserver.pythonStartupArgs