SlideShare a Scribd company logo
1 of 18
Download to read offline
Initiation the Java web application
project in Google App Engine
Artur Machura
24.12.2022, Katowice
Abstract
• Opening the presentation
• Introduction
• Main part
• Conclusion
Milestones
1. Create your project
2. Install the software needed for programming
3. Write your web service
4. Deploy your web service
5. Additionally - Continued work in STS4
Understand the basics concepts before
you start
1. Google App Engine GAE (at https://cloud.google.com/appengine,
distinguish at the outset the Google Web Toolkit GWT)
2. JAVA (this is one of the languages supported by GAE, the others are for
example Python, Go etc. https://www.java.com/ )
3. Spring (there are many projects related to this concept, e.g. spring
framework, spring boot and others https://spring.io/projects )
4. Apache Maven and Apache Tomcat (https://www.apache.org/ )
5. REST (Representational State Transfer,
https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm )
Create your project (an option based on a web
browser is described, another is based on the
google CLI)
1. Log in to your google account (or create an account)
https://bit.ly/3GgoEYF
2. Create your first Google cloud project (https://bit.ly/3VqMCVg )
3. Activate your billing account (you get $300 initially,
https://bit.ly/3WJHgFY )
4. Enable the API (https://bit.ly/3ji2Dzu )
5. Create an App Engine application for your Cloud project
(https://bit.ly/3jlLzsl )
Install the software needed for
programming (step 1 -2)
1. Google Cloud CLI (https://cloud.google.com/sdk/docs/install )
• You must initialize it https://cloud.google.com/sdk/docs/initializing
(include command: gcloud components update)
2. Java SE 17 Development Kit
(https://www.oracle.com/java/technologies/downloads/ )
Install the software needed for
programming (step 3)
3. Apache Maven (https://maven.apache.org/download.cgi )
• To deploy using Maven, you will need to add the App Engine Maven Plugin
to yout pom.xml file
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.4.4</version>
</plugin>
Write your first web service, step 1 - 3
(locally on your computer)
1. Go to the Spring Iinitializr
page (https://start.spring.io/ )
2. Generate a Spring Boot
project (options in this case
are: maven, java 17)
3. Unpack it in a local folder
(to user's home directory
.m2repository)
Write your first web service, step 4
4. Modify the main class
SpringbootApplication.java (note
the filename - which is different by
default)
import org.springframework.boot.SpringApplication;
import
org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class SpringbootApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootApplication.class, args);
}
@GetMapping("/")
public String hello() {
return "Hello world!";
}
}
„The modified class is a controller
that starts Spring Boot's embedded
Tomcat server and responds
to GET requests at the root path
('/') with the text "Hello world!”
Write your first web service, step 4
1. Running the server locally (google CLI)
mvn spring-boot:run
2. In your web browser, enter the following address:
http://localhost:8080
! The Hello World message from the sample app displays on the page. In
your terminal window, press Ctrl+C to exit the web server.
Deploy your web service (to the cloud
platform) step 1-2
1. Add an app.yaml file to deploy your service to App Engine
(to user's home directory.m2repositoryspringbootsrcmainappengine)
2. Edit an app.yaml file
runtime: java17
Deploy your web service (to the cloud
platform) step 3
1. In your java folder, where your Maven pom.xml file is located, run the
followien command in you terminal:
gcloud app deploy
2. Viewing your service, use the following command:
gcloud app browse
Continue work in STS4 (step 1)
1. Download and install STS 4
https://spring.io/tools
2. Import your first project
(file>import>Maven>Existing
Projects)
Continue work in STS4 (step 2)
1. Make any changes, e.g. the text
„Hello world! STS4” (it was in
SpringbootApplication.java class)
2. Check on your local server to see if
it works
• Run „Spring Boot App” (from menu
STS4)
• Check website (by default it is an
adress http://localhost:8080/)
Continue work in STS4 (step 3)
1. In google CLI deploy your service (but if you have been logged out in
the meantime, you will have to log in and set up the project).
• gcloud auth login
• gcloud config set project …
• gcloud app deploy (make sure you are in the project directory where the
pom.xml file is located)
2. Check you project address
• gcloud app browse
Source
• Java 11/17 runtime environment
https://cloud.google.com/appengine/docs/standard/java-gen2/runtime
• and others mentioned in the presentation
Thank you for your attention! Please
submit any comments on the
software-engineers.org
PhD Artur Machura
arturmachura.info
InitiateAEv2.pdf

More Related Content

Similar to InitiateAEv2.pdf

Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakayaMbakaya Kwatukha
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Appschrisb206 chrisb206
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxmoirarandell
 
Opensource gis development - part 1
Opensource gis development - part 1Opensource gis development - part 1
Opensource gis development - part 1Andrea Antonello
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsSteve Keener
 
How to use_cucumber_rest-assured_api_framework
How to use_cucumber_rest-assured_api_frameworkHow to use_cucumber_rest-assured_api_framework
How to use_cucumber_rest-assured_api_frameworkHarshad Ingle
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...Sencha
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 
Spring Live Sample Chapter
Spring Live Sample ChapterSpring Live Sample Chapter
Spring Live Sample ChapterSyed Shahul
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!🎤 Hanno Embregts 🎸
 
Seven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseSeven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseMatt Raible
 
A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.Subramanyam Vemala
 

Similar to InitiateAEv2.pdf (20)

Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakaya
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
 
Installing the java sdk
Installing the java sdkInstalling the java sdk
Installing the java sdk
 
Opensource gis development - part 1
Opensource gis development - part 1Opensource gis development - part 1
Opensource gis development - part 1
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 
How to use_cucumber_rest-assured_api_framework
How to use_cucumber_rest-assured_api_frameworkHow to use_cucumber_rest-assured_api_framework
How to use_cucumber_rest-assured_api_framework
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
Exploring Maven SVN GIT
Exploring Maven SVN GITExploring Maven SVN GIT
Exploring Maven SVN GIT
 
Spring Live Sample Chapter
Spring Live Sample ChapterSpring Live Sample Chapter
Spring Live Sample Chapter
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!
 
Flask
FlaskFlask
Flask
 
What's new in p2 (2009)?
What's new in p2 (2009)?What's new in p2 (2009)?
What's new in p2 (2009)?
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Seven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseSeven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuse
 
A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.
 
Qa process
Qa processQa process
Qa process
 
Gwt portlet
Gwt portletGwt portlet
Gwt portlet
 

More from University of Economics in Katowice

More from University of Economics in Katowice (20)

python_function.pdf
python_function.pdfpython_function.pdf
python_function.pdf
 
python_p4_v2.pdf
python_p4_v2.pdfpython_p4_v2.pdf
python_p4_v2.pdf
 
python_p3.pdf
python_p3.pdfpython_p3.pdf
python_p3.pdf
 
python_p2v2_publikacja.pdf
python_p2v2_publikacja.pdfpython_p2v2_publikacja.pdf
python_p2v2_publikacja.pdf
 
python_p1.pdf
python_p1.pdfpython_p1.pdf
python_p1.pdf
 
TechnologyStack_basicsv2.pdf
TechnologyStack_basicsv2.pdfTechnologyStack_basicsv2.pdf
TechnologyStack_basicsv2.pdf
 
barplotv4.pdf
barplotv4.pdfbarplotv4.pdf
barplotv4.pdf
 
ie.pdf
ie.pdfie.pdf
ie.pdf
 
puś.ppt
puś.pptpuś.ppt
puś.ppt
 
swd.pdf
swd.pdfswd.pdf
swd.pdf
 
EARv3.pdf
EARv3.pdfEARv3.pdf
EARv3.pdf
 
Projektowanie i implementacja usług sieciowych
Projektowanie i implementacja usług sieciowychProjektowanie i implementacja usług sieciowych
Projektowanie i implementacja usług sieciowych
 
Angular10302021
Angular10302021Angular10302021
Angular10302021
 
Środowisko PWA
Środowisko PWAŚrodowisko PWA
Środowisko PWA
 
Kolo REST
Kolo RESTKolo REST
Kolo REST
 
Inicjacja wg OpenUP
Inicjacja wg OpenUPInicjacja wg OpenUP
Inicjacja wg OpenUP
 
Dyscyplina zarządzania projektami wg OpenUP
Dyscyplina zarządzania projektami wg OpenUPDyscyplina zarządzania projektami wg OpenUP
Dyscyplina zarządzania projektami wg OpenUP
 
Atrybut zgodności
Atrybut zgodnościAtrybut zgodności
Atrybut zgodności
 
Wstęp do dyscypliny wymagań w projektach IT
Wstęp do dyscypliny wymagań w projektach ITWstęp do dyscypliny wymagań w projektach IT
Wstęp do dyscypliny wymagań w projektach IT
 
Projektowanie systemowinformatycznychprezentacjabazowa
Projektowanie systemowinformatycznychprezentacjabazowaProjektowanie systemowinformatycznychprezentacjabazowa
Projektowanie systemowinformatycznychprezentacjabazowa
 

Recently uploaded

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 

Recently uploaded (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 

InitiateAEv2.pdf

  • 1. Initiation the Java web application project in Google App Engine Artur Machura 24.12.2022, Katowice
  • 2. Abstract • Opening the presentation • Introduction • Main part • Conclusion
  • 3. Milestones 1. Create your project 2. Install the software needed for programming 3. Write your web service 4. Deploy your web service 5. Additionally - Continued work in STS4
  • 4. Understand the basics concepts before you start 1. Google App Engine GAE (at https://cloud.google.com/appengine, distinguish at the outset the Google Web Toolkit GWT) 2. JAVA (this is one of the languages supported by GAE, the others are for example Python, Go etc. https://www.java.com/ ) 3. Spring (there are many projects related to this concept, e.g. spring framework, spring boot and others https://spring.io/projects ) 4. Apache Maven and Apache Tomcat (https://www.apache.org/ ) 5. REST (Representational State Transfer, https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm )
  • 5. Create your project (an option based on a web browser is described, another is based on the google CLI) 1. Log in to your google account (or create an account) https://bit.ly/3GgoEYF 2. Create your first Google cloud project (https://bit.ly/3VqMCVg ) 3. Activate your billing account (you get $300 initially, https://bit.ly/3WJHgFY ) 4. Enable the API (https://bit.ly/3ji2Dzu ) 5. Create an App Engine application for your Cloud project (https://bit.ly/3jlLzsl )
  • 6. Install the software needed for programming (step 1 -2) 1. Google Cloud CLI (https://cloud.google.com/sdk/docs/install ) • You must initialize it https://cloud.google.com/sdk/docs/initializing (include command: gcloud components update) 2. Java SE 17 Development Kit (https://www.oracle.com/java/technologies/downloads/ )
  • 7. Install the software needed for programming (step 3) 3. Apache Maven (https://maven.apache.org/download.cgi ) • To deploy using Maven, you will need to add the App Engine Maven Plugin to yout pom.xml file <plugin> <groupId>com.google.cloud.tools</groupId> <artifactId>appengine-maven-plugin</artifactId> <version>2.4.4</version> </plugin>
  • 8. Write your first web service, step 1 - 3 (locally on your computer) 1. Go to the Spring Iinitializr page (https://start.spring.io/ ) 2. Generate a Spring Boot project (options in this case are: maven, java 17) 3. Unpack it in a local folder (to user's home directory .m2repository)
  • 9. Write your first web service, step 4 4. Modify the main class SpringbootApplication.java (note the filename - which is different by default) import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication @RestController public class SpringbootApplication { public static void main(String[] args) { SpringApplication.run(SpringbootApplication.class, args); } @GetMapping("/") public String hello() { return "Hello world!"; } } „The modified class is a controller that starts Spring Boot's embedded Tomcat server and responds to GET requests at the root path ('/') with the text "Hello world!”
  • 10. Write your first web service, step 4 1. Running the server locally (google CLI) mvn spring-boot:run 2. In your web browser, enter the following address: http://localhost:8080 ! The Hello World message from the sample app displays on the page. In your terminal window, press Ctrl+C to exit the web server.
  • 11. Deploy your web service (to the cloud platform) step 1-2 1. Add an app.yaml file to deploy your service to App Engine (to user's home directory.m2repositoryspringbootsrcmainappengine) 2. Edit an app.yaml file runtime: java17
  • 12. Deploy your web service (to the cloud platform) step 3 1. In your java folder, where your Maven pom.xml file is located, run the followien command in you terminal: gcloud app deploy 2. Viewing your service, use the following command: gcloud app browse
  • 13. Continue work in STS4 (step 1) 1. Download and install STS 4 https://spring.io/tools 2. Import your first project (file>import>Maven>Existing Projects)
  • 14. Continue work in STS4 (step 2) 1. Make any changes, e.g. the text „Hello world! STS4” (it was in SpringbootApplication.java class) 2. Check on your local server to see if it works • Run „Spring Boot App” (from menu STS4) • Check website (by default it is an adress http://localhost:8080/)
  • 15. Continue work in STS4 (step 3) 1. In google CLI deploy your service (but if you have been logged out in the meantime, you will have to log in and set up the project). • gcloud auth login • gcloud config set project … • gcloud app deploy (make sure you are in the project directory where the pom.xml file is located) 2. Check you project address • gcloud app browse
  • 16. Source • Java 11/17 runtime environment https://cloud.google.com/appengine/docs/standard/java-gen2/runtime • and others mentioned in the presentation
  • 17. Thank you for your attention! Please submit any comments on the software-engineers.org PhD Artur Machura arturmachura.info