Skip to content

Latest commit

 

History

History

helloworld-jsp

Java Server Pages based Hello World app

Requirements

Setup

Use either:

  • gcloud init
  • gcloud beta auth application-default login

Set your project, the plugins in this example are configured to use this value from gcloud

  • gcloud config set project <YOUR_PROJECT_NAME>

We support building with Maven, Gradle, and IntelliJ IDEA. The samples have files to support both Maven and Gradle. To use the IDE plugins, see the documentation pages above.

Maven

Using Maven and the App Engine Plugin & Maven Plugin Goals and Parameters

Running locally

$ mvn jetty:run-exploded

Deploying

  • In the pom.xml, update the App Engine Maven Plugin with your Google Cloud Project Id:

    <plugin>
      <groupId>com.google.cloud.tools</groupId>
      <artifactId>appengine-maven-plugin</artifactId>
      <version>2.3.0</version>
      <configuration>
        <projectId>GCLOUD_CONFIG</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.

  • Deploy your App

      $ mvn package appengine:deploy
    

Gradle

Using Gradle and the App Engine Plugin & Gradle Tasks and Parameters

Running locally

$ gradle jettyRun

Deploying

$ gradle appengineDeploy