- 是一个搭建程序的脚手架
- 主要关注业务而并配置
- 用springboot解决复杂的配置,和混乱的依赖管理
- 内嵌了tomcat 减少了大量繁琐的配置
- 提供大量已经封装好的启动器,启动器里面帮我们进行jar包的版本以及冲突
依赖
<!-- 所有的springboot的工程都以spring父工程为父工程 -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
</parent>
<!--spring-boot-starter-web 是springboot整合springMVC是maven的依赖继承关系 -->
<!--里面有内置tomcat,aop,log4j-->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>
springboot入门:
- 导入spring-boot-starter-parent作为父工程
- 导入相关联的启动器
- 创建引导类 就是main方法启动啥的
- 像springmvc一样写controller
注解:
- springbootApplication包含三个注解
- EnableAutoConfiguration
- ComponentScan
- SpringBootConfiguration
- Configuration当前类为配置嘞
- PropertySource指定属性文件的路径
- value
- bean
- controller
- RestController
- GetMapping
- ConfigurationProperties注解声明当前类为属性读取类