Once 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:deployCron |
Deploys a cron.yaml configuration file to App Engine. |
appengine:deployDispatch |
Deploys a dispatch.yaml configuration
file to App Engine. |
appengine:deployDos |
Deploys a dos.yaml configuration file to App Engine. |
appengine:deployIndex |
Deploys an index.yaml configuration
file to App Engine. |
appengine:deployQueue |
Deploys a queue.yaml configuration file to App Engine. |
appengine:help |
Displays help information on the App Engine Maven plugin. |
appengine:stage |
Generates an application build directory for deployment. |
For more information on how to set up and use Maven, see Using Maven.
Using parameters
Each goal has associated parameters that you can specify in the pom.xml
file.
For example:
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.2.0</version>
<configuration>
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
<cloudSdkPath>/usr/foo/path/to/cloudsdk</cloudSdkPath>
</configuration>
</plugin>
</plugins>
You can also define configuration parameters in the command line, following the
pattern -D[USER_PROPERTY]=[PARAMETER_VALUE]
.
For example, to specify a directory to which to stage your application:
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
or gcloud app services
command line flags :
Parameter | Description | User Property |
---|---|---|
appEngineDirectory |
The directory that contains app.yaml and other supported
App Engine configuration files. Default is
${basedir}/src/main/appengine . |
app.stage.appEngineDirectory |
artifact |
The location of the JAR or WAR archive to deploy. Default is
${project.build.directory}/${project.build.finalName}.${project.packaging} . |
app.stage.artifact |
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. | app.deploy.bucket |
cloudSdkPath |
Optional parameter to configure the location of the Cloud SDK. Default is to automatically discover from the PATH or standard install location. | cloudSdkPath |
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. |
app.deploy.deployables |
dockerDirectory |
The directory containing the Dockerfile and other Docker resources.
Default is
${basedir}/src/main/docker/ . |
app.stage.dockerDirectory |
imageUrl |
Deploy with a specific Docker image. ImageUrl must be
a valid Container Registry name, for example, gcr.io/foo ,
where foo is the name of the image. |
app.deploy.imageUrl |
projectId |
The Google Cloud project name to use for this invocation. Default is the current project selected when initializing `gcloud`. | app.deploy.projectId |
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 |
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 on 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 is
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:stage
Generates an application build directory for deployment.
You can use the following parameters:
Parameter | Description | User Property |
---|---|---|
appEngineDirectory |
The directory that contains app.yaml and other supported
App Engine configuration files. Default is
${basedir}/src/main/appengine . |
app.stage.appEngineDirectory |
artifact |
The location of the JAR or WAR archive to deploy. Default is
${project.build.directory}/${project.build.finalName}.${project.packaging} . |
app.stage.artifact |
cloudSdkPath |
Optional parameter to configure the location of the Cloud SDK. | cloudSdkPath |
dockerDirectory |
The directory containing the Dockerfile and other Docker resources.
Default is
${basedir}/src/main/docker/ ${basedir}/src/main/docker/ . |
app.stage.dockerDirectory |
stagingDirectory |
Required. The directory to which to stage the application. Default is
${project.build.directory}/appengine-staging |
app.stage.stagingDirectory |