Google Cloud Platform provides a cloud computing services that run the Spring Boot application in the cloud environment in much simpler and seamlessly manner. In this blog we will talk about Google Cloud Platform and Spring boot and how users can deploy spring boot application in App Engine Google Cloud Platform.
Google Cloud Platform (GCP):
Google Cloud Platform is offered by Google, is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search, Gmail, Google Drive, and YouTube. Google App Engine lets app developers build scalable web and mobile back ends in any programming language on a fully managed serverless platform.
Java Spring Boot:
Java Spring Framework (Spring Framework) is a popular, open source, enterprise-level framework for creating standalone, production-grade applications that run on the Java Virtual Machine (JVM).
Java Spring Boot (Spring Boot) is a tool that makes developing web application and microservices with Spring Framework faster and easier through three core capabilities:
Autoconfiguration
An opinionated approach to configuration
The ability to create standalone applications
These features work together to provide you with a tool that allows you to set up a Spring-based application with minimal configuration and setup.
Step for spring boot application deployment:
For deploying spring boot application user should follow following steps:
There are two ways to deploy a Java server app—either by using Maven App Engine Plugin or Gradle App Engine Plugin, or by deploying the war package directory. You’ll use Maven App Engine Plugin to deploy the app.
Add Maven App Engine Plugin
Update pom.xml to include a Google Cloud plugin that simplifies the deployment process. You can use Vim, nano, or Emacs to edit the file.
Then, deploy your app to App Engine standard environment by running following command:
$ mvn appengine:deploy.
$ ./mvnw -DskipTests package appengine:deploy
… first time deploy may take a couple of minutes
After the app is deployed, you can visit it by opening http://<project-id>.appspot.com in your web browser or use the following command in Cloud Shell:
$ gcloud app browse
… [It may print out the URL for your app]
Congratulations! You have successfully written and deployed your first demo app to GCP.