Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Labs

Build a Java Application Using Gradle with the Google Cloud App Engine Gradle Plugin

Hey, Gurus! Welcome to the lab. In this lab, you are going to use Gradle and the Google Cloud App Engine plugin to deploy a Java `Hello` app to App Engine in Google Cloud. Let's get started.

Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 0m
Published
Clock icon Sep 22, 2023

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create the Gradle Java Project

    In the Google Cloud Console:

    1. Log in to the Google Cloud Console.
    2. Go to the App Engine section of the console.
    3. Go to the Cloud Shell and configure.

    In Cloud Shell:

    1. Install SDKMAN using the curl command provided.
    2. Install Java 11.
    3. Install Gradle.
    4. Create the guru_gcp project directory.
    5. Move into the guru_gcp directory.
    6. Initialize the guru_gcp directory to build the scaffolding for the project.
    7. Clone the lab GitHub repo to a directory called gradle_lab.
  2. Challenge

    Modify the Java Application

    In Cloud Shell:

    1. Move the files found in the gradle_lab/GCP directory to the guru_gcp directory.
    2. Add the src directory to your build, and add the plugin block needed for the App Engine plugin.
    3. Modify the build file and add the App Engine plugin, App Engine dependency, and add the path to your application to it.
    4. Add the project name to the HelloServlet.java file.
  3. Challenge

    Create and Deploy the HelloServlet

    In Cloud Shell:

    1. Create the App Engine Application.
    2. Deploy the application to App Engine using the deploy task.
    3. Use the gcloud command to get the URL for the app.

    In browser:

    1. Copy the URL and paste it into you browser with a trailing /hello.
    2. Confirm you get the Hello, Google App Engine! message in your browser.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans