自动装配原理

pom.xml

1.引入springboot依赖的时候,不需要指定版本,就因为有这些版本仓库

2.spring-boot0dependencies:核心依赖在父工程中.

启动器

1
2
3
4
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

这个就是web场景下的启动器,会自动导入web环境下的所有依赖.

主程序

@SpringBootApplication标注这个类是SpringBoot的应用