Skip to content
sugarbomb edited this page Feb 8, 2022 · 4 revisions

Welcome to the LearnSpringBoot wiki!

LearnSpringBoot

SpringBoot

简介

是继承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

Clone this wiki locally