Springboot自动配置原理

核心依赖

spring-boot-dependencies 核心依赖在父工程里,里面存放了大量的jar包文件
在写springboot依赖时,不需要指定版本。因为有这些版本仓库。

启动器

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

说白了就是springboot的启动场景
比如web就是
spring-boot-starter-web
就会自动导入web的依赖

主程序

package com.jie;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication//标记是springboot的一个应用
public class Springboot01HelloworldApplication {

    public static void main(String[] args) {
        //将spring启动
        SpringApplication.run(Springboot01HelloworldApplication.class, args);
    }
}

注解分析

https://blog.csdn.net/qq_33369905/article/details/106647293?spm=1001.2014.3001.5502

posted @ 2021-05-12 20:50  一个经常掉线的人  阅读(74)  评论(0)    收藏  举报