In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about what are the four core components of SpringBoot in Java. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Spring Boot Starter1.1 Starter application example org.springframework.boot spring-boot-starter-thymeleaf org.mybatis.spring.boot mybatis-spring-boot-starter 1.3.2
You will always see these two dependencies in the POM file of our Spring Boot project:
Spring-boot-starter-xxx and xxx-spring-boot-starter.
This is starter, one of the four components of spring boot.
The official starter goes like this: spring-boot-starter-xxx unofficial starter goes like this: xxx-spring-boot-starter
Summary:
An and Starter help us package all the needed dependencies and avoid some Jar package conflicts or lack of packages caused by our own additions.
B and Starter help us automatically inject the required Bean instances into the Spring container without our manual configuration (this can be said to be done by starter, but in fact it is not, there is a hole here, the answer below)
So: the content of the starter package is the pom file, which is a dependency delivery package.
II. Brief introduction of Spring Boot Autoconfigure2.1 autoconfigure
Autoconfigure is not perceived in our development because it exists in our starter. So each of our starter relies on autoconfigure:
We can also put the contents of autoconfig directly in the starter package.
The autoconfigure content is the actual code implementation package that configures the Bean instance to the Spring container and then provides it to the starter dependency. So the configuration of Bean instance to Spring container mentioned in item b of summary 1 is actually done by autoconfigure. Because starter depends on it, it can also be said to be done by starter.
So: autocinfigure is the code implementation of the capabilities embodied by starter.
III. Spring Boot CLI
Spring Boot CLI is a client tool that uses Spring Boot on the command line; the main functions are as follows:
Run the groovy script
Package the groovy file to jar
Initialize the Spring Boot project
You can execute groovy scripts directly from the command line
IV. Spring Boot actuator
Actuator is the monitoring plug-in of Spring Boot, which provides many interfaces to obtain the running status indicators of the current project.
Org.springframework.boot spring-boot-starter-actuatormanagement: endpoint: health: # # enable health monitoring endpoint enabled: true beans: # # enable Bean instance monitoring endpoint enabled: true
Browser access (view monitoring information address): http://localhost:9500/actuator
Check your health.
Thank you for reading! This is the end of this article on "what are the four core components of SpringBoot in Java". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un