springboot-springboot interview questions and answers series 1
1. The purpose of this post
From this post on, I would show some questions and answers of springboot interviews.
2. Environments
- springboot 1.x and 2.x
3. Springboot Interview Questions and Answers Series 1
3.1 How to configure springboot apps by Maven?
There are two ways to do this job, one is by extending from spring-boot-starter-parent:
But if your pom already has a parent, then you can use the dependencyManagement to import springboot artifacts:
3.2 What’s’ core annotation of springboot? And what’s mainly composed of?
The core annotation is the @SpringBootApplication, it’s composed of these sub-annotations:
-
@SpringBootConfiguration:it’s composed of @Configuration ,implement the auto configuration.
-
@EnableAutoConfiguration:Enable the auto configuration of spring boot apps. You can disalbe some auto configuration options by using exclude like this: @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })。
-
@ComponentScan:Enable the component scan。
To be continued…