Skip to content

Files

This branch is 42 commits behind GoogleCloudPlatform/java-docs-samples:main.

helloworld

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 11, 2024
Oct 15, 2024
Oct 15, 2024
Oct 11, 2024
Oct 11, 2024
Oct 11, 2024
Oct 4, 2024
Oct 11, 2024

HelloWorld for App Engine Standard (Java 21)

This sample demonstrates how to deploy an application on Google App Engine.

See the Google App Engine standard environment documentation for more detailed instructions.

Setup

• Download and initialize the Cloud SDK

gcloud init
  • Create an App Engine app within the current Google Cloud Project
gcloud app create
<plugin>
  <groupId>com.google.cloud.tools</groupId>
  <artifactId>appengine-maven-plugin</artifactId>
  <version>2.8.0</version>
  <configuration>
    <projectId>myProjectId</projectId>
    <version>GCLOUD_CONFIG</version>
  </configuration>
</plugin>

Note: GCLOUD_CONFIG is a special version for autogenerating an App Engine version. Change this field to specify a specific version name.

Maven

Running locally

mvn package appengine:run

To use visit: http://localhost:8080/

Deploying

mvn package appengine:deploy

To use visit: https://YOUR-PROJECT-ID.appspot.com

Testing

mvn verify

As you add / modify the source code (src/main/java/...) it's very useful to add unit testing to (src/main/test/...). The following resources are quite useful:

Gradle

Running locally

./gradlew appengineRun

To use vist: http://localhost:8080/

Deploying

./gradlew appengineDeploy