- Lab
- A Cloud Guru
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.
Path Info
Table of Contents
-
Challenge
Create the Gradle Java Project
In the Google Cloud Console:
- Log in to the Google Cloud Console.
- Go to the App Engine section of the console.
- Go to the Cloud Shell and configure.
In Cloud Shell:
- Install SDKMAN using the curl command provided.
- Install Java 11.
- Install Gradle.
- Create the
guru_gcp
project directory. - Move into the
guru_gcp
directory. - Initialize the
guru_gcp
directory to build the scaffolding for the project. - Clone the lab GitHub repo to a directory called
gradle_lab
.
-
Challenge
Modify the Java Application
In Cloud Shell:
- Move the files found in the
gradle_lab/GCP
directory to theguru_gcp
directory. - Add the
src
directory to your build, and add the plugin block needed for theApp Engine plugin
. - Modify the build file and add the
App Engine plugin
,App Engine dependency
, and add the path to your application to it. - Add the project name to the
HelloServlet.java
file.
- Move the files found in the
-
Challenge
Create and Deploy the HelloServlet
In Cloud Shell:
- Create the
App Engine Application
. - Deploy the application to
App Engine
using thedeploy task
. - Use the
gcloud
command to get the URL for the app.
In browser:
- Copy the URL and paste it into you browser with a trailing /hello.
- Confirm you get the
Hello, Google App Engine!
message in your browser.
- Create the
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.