-
Notifications
You must be signed in to change notification settings - Fork 0
Home
sugarbomb edited this page Feb 8, 2022
·
4 revisions
Welcome to the LearnSpringBoot wiki!
是继承Spring框架开发的解决方案,目的是简化初始化搭建和开发过程
- 内嵌很多优秀项目,一站式解决。
- 只用Spring4.0的注解,减少编写配置的工作,Spring4也是运行Spring Boot应用程序的最低要求 。
- 有父级maven管理了第三方库的依赖,减少了版本冲突问题,仲裁中心
- 开箱即用。
springboot是springcould的基础,微服务Springcould的流行带动了springboot。
1 创建maven项目
2 引入依赖
- 使用 不同的场景启动器starter维护了对应的依赖 简化了maven文件的书写 如
spring-boot-starter-web就维护了一个web应用相关的依赖3 启动类
- 使用
@SpringbootApplication注解的启动类,是springboot程序的入口类。- 同时由spring将此类作为配置文件进行自动环境配置,Spring底层也会将此类所在的包作为扫描包,进行加载映射,所以要注意加此类放在放在所有bean的根目录中
- 相当于
@configuration+@componentscan。由于springboot中约定大于配置的原则,此类的名字只能写成Application