SlideShare a Scribd company logo
Building aBuilding a
Spring BootSpring Boot
ApplicationApplication
(ask the audience)(ask the audience)
Hanno Embregts @hannotify
Hanno?Hanno?Hanno?Hanno?Hanno?
IntroducingIntroducingIntroducingIntroducingIntroducing
Spring BootSpring BootSpring BootSpring BootSpring Boot
Spring Boot?Spring Boot?
( )
"Takes an opinionated view of building
production-ready Spring applications.
Favors convention over con guration and
is designed to get you up and running as
quickly as possible."
https://projects.spring.io/spring-boot
Key features?Key features?
create stand-alone Spring applications
embed web server directly (no WAR les)
automatic Spring con guration wherever
possible
no code generation and no XML con guration
still offering all Spring features.
Pros?Pros?
no separate web server needed
better debugging in IDEs
faster deployments (about 50%)
no web.xml or con guration classes needed
up and running with one Java le and a build
script.
( )https://www.ethode.com/blog/6-simple-reasons-why-spring-boot-rocks
Cons?Cons?
custom con guration will be a bit of a puzzle
porting your legacy Spring project would be a
disaster!
it uses Spring, excluding roughly half of the Java
community.
Starting OutStarting OutStarting OutStarting OutStarting Out
About What We ClaimedAbout What We Claimed
Earlier...Earlier...
"up and running with one Java le and a
build script"
Java le(s)Java le(s)
// imports...
@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
return "Greetings from Spring Boot!";
}
}
// imports...
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Build scriptBuild script
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
jar {
// some properties...
}
// repositories...
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile("junit:junit")
}
Starter DependenciesStarter Dependencies
a set of convenient dependency descriptors
follow the naming pattern spring-boot-starter-
*
Name Purpose
spring-boot-starter Core starter, includes auto-con g & logging
spring-boot-starter-test Test starter, includes JUnit, Hamcrest & Mockito
spring-boot-starter-web Starter for Spring MVC Web applications
spring-boot-starter-data-jpa Spring Data with JPA
(more starters at
)
http://docs.spring.io/spring-
boot/docs/current/reference/htmlsingle/#using-boot-starter
Spring InitializrSpring Initializr
(a quick way to download a project setup)
http://start.spring.io/
Live codingLive codingLive codingLive codingLive coding
Kahoot! #1
Kahoot! #2
Implementing RepositoryImplementing Repository
MethodsMethods
De ne them in a @Query annotation
Use one of the many supported query methods
(
)
https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query-
methods.query-creation
List<Entity> findByNameContainingIgnoreCase(String name);
Wrap-up &Wrap-up &Wrap-up &Wrap-up &Wrap-up &
QuestionsQuestionsQuestionsQuestionsQuestions
Wrap-upWrap-up
Spring Boot
gets you up & running quickly;
assumes standard con guration for rapid
development;
plays nice with a wide range of frameworks;
is up to the task no matter what choices you make.
And what if I prefer JavaEE?And what if I prefer JavaEE?
At least you can use embedded servers:
TomEE Embedded
( )
Wild y Swarm
( )
Quick assembly with JBoss ShrinkWrap
(
)
http://tomee.apache.org/advanced/tomee-embedded/index.html
http://wild y-swarm.io/
http://www.lordofthejars.com/2014/09/apache-tomee-shrinkwrap-javaee-boot-
not.html
Any questions?Any questions?Any questions?Any questions?Any questions?
Thank you! ☺Thank you! ☺
Just can't get enough?
https://hannotify.github.io
@hannotify
hanno.embregts@infosupport.com

More Related Content

What's hot (20)

PDF
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Matt Raible
 
PDF
Front End Development for Back End Developers - UberConf 2017
Matt Raible
 
PDF
Spring Boot Intro
Alberto Flores
 
PDF
Ionic2
Jiayun Zhou
 
PDF
Rapidly scaffold your frontend with yeoman
Simon Waibl
 
PPTX
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Deepu S Nath
 
PDF
Front end workflow with yeoman
hassan hafez
 
PPTX
Spring Boot Tutorial
Naphachara Rattanawilai
 
PPT
Behat sauce
Shashikant Jagtap
 
PDF
Intro JavaScript
koppenolski
 
PDF
Introduction to Spring Boot!
Jakub Kubrynski
 
PDF
Using JHipster for generating Angular/Spring Boot apps
Yakov Fain
 
PPTX
Gdg ionic 2
Shang Yi Lim
 
PDF
Up & running with ECMAScript6
Nir Kaufman
 
PDF
Spring IO '15 - Developing microservices, Spring Boot or Grails?
Fátima Casaú Pérez
 
PDF
Automatic Functional Testing with Selenium and SauceLabs
Joseph Chiang
 
PPTX
Angularjs Tutorial for Beginners
rajkamaltibacademy
 
PPTX
Nightwatch JS for End to End Tests
Sriram Angajala
 
PDF
Sergey Puzankov "How to see a bug the size of 1px"
Fwdays
 
PDF
An iOS Developer's Perspective on React Native
Aleksandras Smirnovas
 
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Matt Raible
 
Front End Development for Back End Developers - UberConf 2017
Matt Raible
 
Spring Boot Intro
Alberto Flores
 
Ionic2
Jiayun Zhou
 
Rapidly scaffold your frontend with yeoman
Simon Waibl
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Deepu S Nath
 
Front end workflow with yeoman
hassan hafez
 
Spring Boot Tutorial
Naphachara Rattanawilai
 
Behat sauce
Shashikant Jagtap
 
Intro JavaScript
koppenolski
 
Introduction to Spring Boot!
Jakub Kubrynski
 
Using JHipster for generating Angular/Spring Boot apps
Yakov Fain
 
Gdg ionic 2
Shang Yi Lim
 
Up & running with ECMAScript6
Nir Kaufman
 
Spring IO '15 - Developing microservices, Spring Boot or Grails?
Fátima Casaú Pérez
 
Automatic Functional Testing with Selenium and SauceLabs
Joseph Chiang
 
Angularjs Tutorial for Beginners
rajkamaltibacademy
 
Nightwatch JS for End to End Tests
Sriram Angajala
 
Sergey Puzankov "How to see a bug the size of 1px"
Fwdays
 
An iOS Developer's Perspective on React Native
Aleksandras Smirnovas
 

Similar to Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018) (20)

PDF
Building a Spring Boot Application - Ask the Audience!
🎤 Hanno Embregts 🎸
 
PDF
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
🎤 Hanno Embregts 🎸
 
PDF
Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...
🎤 Hanno Embregts 🎸
 
PDF
Spring Boot Interview Questions PDF By ScholarHat
Scholarhat
 
PDF
Spring boot jpa
Hamid Ghorbani
 
PPTX
Module 6 _ Spring Boot for java application to begin
Deepakprasad838637
 
PDF
Spring Boot
Jaran Flaath
 
PPTX
Java and services code lab spring boot and spring data using mongo db
Staples
 
PPTX
Java and services code lab spring boot and spring data using mongo db
Staples
 
PDF
Spring Boot
HongSeong Jeon
 
PPTX
Spring boot
Gyanendra Yadav
 
PPTX
Spring boot Introduction
Jeevesh Pandey
 
PDF
Spring Boot Whirlwind Tour
VMware Tanzu
 
PPTX
dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx
Appster1
 
PPTX
Introduction to spring boot
Santosh Kumar Kar
 
PDF
Spring Boot & Actuators
VMware Tanzu
 
PDF
Spring boot vs spring framework razor sharp web applications
Katy Slemon
 
PDF
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
Mek Srunyu Stittri
 
PDF
Spring boot wednesday
Vinay Prajapati
 
PPTX
Top 10 Spring Boot Interview Questions and Answers
narendrachinnu
 
Building a Spring Boot Application - Ask the Audience!
🎤 Hanno Embregts 🎸
 
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
🎤 Hanno Embregts 🎸
 
Building a Spring Boot 2 Application - Ask the Audience! (from Voxxed Days Vi...
🎤 Hanno Embregts 🎸
 
Spring Boot Interview Questions PDF By ScholarHat
Scholarhat
 
Spring boot jpa
Hamid Ghorbani
 
Module 6 _ Spring Boot for java application to begin
Deepakprasad838637
 
Spring Boot
Jaran Flaath
 
Java and services code lab spring boot and spring data using mongo db
Staples
 
Java and services code lab spring boot and spring data using mongo db
Staples
 
Spring Boot
HongSeong Jeon
 
Spring boot
Gyanendra Yadav
 
Spring boot Introduction
Jeevesh Pandey
 
Spring Boot Whirlwind Tour
VMware Tanzu
 
dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx
Appster1
 
Introduction to spring boot
Santosh Kumar Kar
 
Spring Boot & Actuators
VMware Tanzu
 
Spring boot vs spring framework razor sharp web applications
Katy Slemon
 
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
Mek Srunyu Stittri
 
Spring boot wednesday
Vinay Prajapati
 
Top 10 Spring Boot Interview Questions and Answers
narendrachinnu
 
Ad

More from 🎤 Hanno Embregts 🎸 (17)

PDF
Pattern Matching: Small Enhancement or Major Feature?
🎤 Hanno Embregts 🎸
 
PDF
Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202
🎤 Hanno Embregts 🎸
 
PDF
"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022
🎤 Hanno Embregts 🎸
 
PDF
"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022
🎤 Hanno Embregts 🎸
 
PDF
Pattern Matching: Small Enhancement or Major Feature?
🎤 Hanno Embregts 🎸
 
PDF
JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"
🎤 Hanno Embregts 🎸
 
PDF
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
🎤 Hanno Embregts 🎸
 
PDF
Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)
🎤 Hanno Embregts 🎸
 
PDF
Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...
🎤 Hanno Embregts 🎸
 
PDF
Entering the Fourth Dimension of OCR with Tesseract
🎤 Hanno Embregts 🎸
 
PDF
The Soft Side of Software Development / Devoxx 2019
🎤 Hanno Embregts 🎸
 
PDF
Beware of Survivorship Bias! (conference talk at J-Fall 2019)
🎤 Hanno Embregts 🎸
 
PDF
Will Git Be Around Forever? A List of Possible Successors
🎤 Hanno Embregts 🎸
 
PDF
Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...
🎤 Hanno Embregts 🎸
 
PDF
QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018
🎤 Hanno Embregts 🎸
 
PDF
QWERTY or DVORAK? Debunking the Keyboard Layout Myths
🎤 Hanno Embregts 🎸
 
PDF
Migrating 25K lines of Ant scripting to Gradle
🎤 Hanno Embregts 🎸
 
Pattern Matching: Small Enhancement or Major Feature?
🎤 Hanno Embregts 🎸
 
Pattern Matching - Small Enhancement or Major Feature? from Developer Week 202
🎤 Hanno Embregts 🎸
 
"Will Git Be Around Forever? A List of Possible Successors" from Devoxx 2022
🎤 Hanno Embregts 🎸
 
"Will Git Be Around Forever? A List of Possible Successors" from FrontMania 2022
🎤 Hanno Embregts 🎸
 
Pattern Matching: Small Enhancement or Major Feature?
🎤 Hanno Embregts 🎸
 
JCON 2021 talk - "Wil Git Be Around Forever? A List of Possible Successors"
🎤 Hanno Embregts 🎸
 
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
🎤 Hanno Embregts 🎸
 
Pattern Matching: Small Enhancement or Major Feature? (talk from jLove 2021)
🎤 Hanno Embregts 🎸
 
Pattern Matching: From Small Enhancement to Major Feature (talk from JavaLand...
🎤 Hanno Embregts 🎸
 
Entering the Fourth Dimension of OCR with Tesseract
🎤 Hanno Embregts 🎸
 
The Soft Side of Software Development / Devoxx 2019
🎤 Hanno Embregts 🎸
 
Beware of Survivorship Bias! (conference talk at J-Fall 2019)
🎤 Hanno Embregts 🎸
 
Will Git Be Around Forever? A List of Possible Successors
🎤 Hanno Embregts 🎸
 
Entering the Fourth Dimension of OCR with Tesseract - Talk from Voxxed Days B...
🎤 Hanno Embregts 🎸
 
QWERTY or DVORAK? Debunking the Keyboard Layout Myths -- from GeeCON 2018
🎤 Hanno Embregts 🎸
 
QWERTY or DVORAK? Debunking the Keyboard Layout Myths
🎤 Hanno Embregts 🎸
 
Migrating 25K lines of Ant scripting to Gradle
🎤 Hanno Embregts 🎸
 
Ad

Recently uploaded (20)

PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 

Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)

  • 1. Building aBuilding a Spring BootSpring Boot ApplicationApplication (ask the audience)(ask the audience) Hanno Embregts @hannotify
  • 4. Spring Boot?Spring Boot? ( ) "Takes an opinionated view of building production-ready Spring applications. Favors convention over con guration and is designed to get you up and running as quickly as possible." https://projects.spring.io/spring-boot
  • 5. Key features?Key features? create stand-alone Spring applications embed web server directly (no WAR les) automatic Spring con guration wherever possible no code generation and no XML con guration still offering all Spring features.
  • 6. Pros?Pros? no separate web server needed better debugging in IDEs faster deployments (about 50%) no web.xml or con guration classes needed up and running with one Java le and a build script. ( )https://www.ethode.com/blog/6-simple-reasons-why-spring-boot-rocks
  • 7. Cons?Cons? custom con guration will be a bit of a puzzle porting your legacy Spring project would be a disaster! it uses Spring, excluding roughly half of the Java community.
  • 8. Starting OutStarting OutStarting OutStarting OutStarting Out
  • 9. About What We ClaimedAbout What We Claimed Earlier...Earlier... "up and running with one Java le and a build script"
  • 10. Java le(s)Java le(s) // imports... @RestController public class HelloController { @RequestMapping("/") public String index() { return "Greetings from Spring Boot!"; } } // imports... @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
  • 11. Build scriptBuild script apply plugin: 'java' apply plugin: 'idea' apply plugin: 'org.springframework.boot' jar { // some properties... } // repositories... dependencies { compile("org.springframework.boot:spring-boot-starter-web") testCompile("junit:junit") }
  • 12. Starter DependenciesStarter Dependencies a set of convenient dependency descriptors follow the naming pattern spring-boot-starter- * Name Purpose spring-boot-starter Core starter, includes auto-con g & logging spring-boot-starter-test Test starter, includes JUnit, Hamcrest & Mockito spring-boot-starter-web Starter for Spring MVC Web applications spring-boot-starter-data-jpa Spring Data with JPA (more starters at ) http://docs.spring.io/spring- boot/docs/current/reference/htmlsingle/#using-boot-starter
  • 13. Spring InitializrSpring Initializr (a quick way to download a project setup) http://start.spring.io/
  • 14. Live codingLive codingLive codingLive codingLive coding
  • 17. Implementing RepositoryImplementing Repository MethodsMethods De ne them in a @Query annotation Use one of the many supported query methods ( ) https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query- methods.query-creation List<Entity> findByNameContainingIgnoreCase(String name);
  • 18. Wrap-up &Wrap-up &Wrap-up &Wrap-up &Wrap-up & QuestionsQuestionsQuestionsQuestionsQuestions
  • 19. Wrap-upWrap-up Spring Boot gets you up & running quickly; assumes standard con guration for rapid development; plays nice with a wide range of frameworks; is up to the task no matter what choices you make.
  • 20. And what if I prefer JavaEE?And what if I prefer JavaEE? At least you can use embedded servers: TomEE Embedded ( ) Wild y Swarm ( ) Quick assembly with JBoss ShrinkWrap ( ) http://tomee.apache.org/advanced/tomee-embedded/index.html http://wild y-swarm.io/ http://www.lordofthejars.com/2014/09/apache-tomee-shrinkwrap-javaee-boot- not.html
  • 21. Any questions?Any questions?Any questions?Any questions?Any questions?
  • 22. Thank you! ☺Thank you! ☺ Just can't get enough? https://hannotify.github.io @hannotify [email protected]