preface

If you don’t know how to set up a Spring Boot project, check out this article. Today, I will teach you how to quickly get started with Spring Boot and build your first Spring Boot project!

What is Spring Boot?

Spring Boot is a sub-project of Spring open source organization. It is a one-stop solution for Spring components. It mainly simplifies the difficulty of using Spring, saves heavy configuration, and provides various initiators for developers to get started quickly.

Spring Boot optimizes the disadvantages of Spring. Based on the idea that convention is superior to configuration, it enables developers to avoid switching between configuration and logical business, thus improving development efficiency and shortening project cycle to a certain extent.

Spring Boot provides a faster getting started experience for Spring-based development.

Spring Boot is out of the box with no code generation, no XML configuration, and the default values can be modified to suit specific requirements.

Spring Boot provides non-functional features common in large projects, such as embedded servers, security, metrics, health checks, external configuration, and more.

Spring Boot is not an enhancement to Spring functionality, but rather provides a quick way to use Spring.

Advantages of Spring Boot

Run independently: Spring Boot is embedded with various servlet containers, such as Tomcat, Jetty, etc. It is no longer necessary to deploy into a war package in the container. Spring Boot can run independently as long as it is packaged into an executable JAR package, and all dependencies are in a jar package.

Simplified configuration: Spring-boot-starter-Web initiators automatically depend on other components, simplifying maven configurations.

Automatic configuration: Spring Boot can automatically configure beans based on classes and JAR packages in the current classpath. For example, a Spring-boot-starter-Web initiator can have web functions without other configuration.

No code generation and XML configuration: There is no code generation during Spring Boot configuration and no XML configuration file is required to do all the configuration work, all with the help of conditional annotations.

Application monitoring: Spring Boot provides a series of endpoints to monitor services and applications for health checks.

What is the relationship between Spring Boot and Spring Cloud?

Based on Spring Boot, Spring Cloud provides a complete set of solutions for architecture problems in microservice system development, including service registration and discovery, service consumption, service protection and fusing, gateway, distributed call tracing, distributed configuration management, etc.

Spring Cloud is a Cloud application development tool based on Spring Boot. Spring Boot focuses on a single entity for fast and easy integration, while Spring Cloud is a global service governance framework. Spring Boot uses the concept of default being greater than configuration. Many integration solutions have already been selected for you. A large part of Spring Cloud is based on Spring Boot.

To learn Spring Cloud, you must learn Spring Boot well.

Environment dependencies for the Spring Boot project

Liverpoolfc.tv: spring. IO/projects/sp… .

GitHub address: github.com/spring-proj… .

IO /guides/ GS/S… .

JDK1.8+ Maven3.5+ Editor Eclipse

How to quickly build your first Spring Boot project

Step 1: Click the link to go to the official website to build the Spring Boot project: start.spring. IO /. Step 2: Enter the official website and select the corresponding version number and write the package name. The system selects the default version number. If you need to change it, you can change it according to your own requirements. Add Spring Web dependencies, of course I’m just building a small Demo here, and you can add other dependencies if you need them. Click the bottom left button to download the installation package.

conclusion

Your first Spring Boot project has been set up, doesn’t it feel easy? But this is just the beginning, and it’s important to keep learning to write more code so that you can better master Spring Boot. Next I will share more knowledge about Spring Boot, looking forward to your attention!