https://docs.spring.io/spring-boot/docs/current/reference/html/
- Introduction to Spring Boot
- What is it
- Radically faster to develop with
- Opinionated out of the box
- Without code generation or XML
- Most of the time used for web development but can be used to develop command line applications too
- System requirements
- Spring Boot 1.x -> Java 7
- Spring Boot 2.x -> Java 8
- What is it
- Spring Boot Maven/Gradle plugin
- Can prodice jar/war
- Create fat jars
- Able to resolve dependency versions using a maven pom import or it's own gradle mechanism
- Supports adding servlet containers out of the box
- Spring Initializr
- Helps to set up an application
- Can be overwhelming first
- https://start.spring.io/
- Creating a spring project manually
- Create an application class like DemoApplication
- The main method should look like this:
public static void main(String[] args) throws Exception { SpringApplication.run(Example.class, args); }
- Auto configuration
- What is it.
- How to override beans provided by autoconfiguration.
- @EnableAutoConfiguration -> Added automatically by @SpringBootApplication
- @SpringBootApplication -> same as @Configuration @EnableAutoConfiguration @ComponentScan
- CLI
- Let you run groovy files to quickly experiment
- Install instructions
- https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/html/getting-started-installing-spring-boot.html#getting-started-manual-cli-installation
- Easy to do, download, unzip and set the PATH environment variable
- Profiles
- Supported by spring too but great supportin in boot.
- Actuator
- Running the application
- java -jar target/myproject-0.0.1-SNAPSHOT.jar
- gradle bootRun
- mvn spring-boot:run
- Customizing the banner
- Command Line Programmoing
- ApplicationRunner or CommandLineRunner -> https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-spring-application.html#boot-features-command-line-runner
- Spring Shell https://projects.spring.io/spring-shell/