初识springboot 细节starters

pom文件中

1父项目

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.9.RELEASE</version>
</parent>

按住CTRL点进去那个spring-boot-starter-parent发现里面还依赖一个父项目叫

spring-boot-dependencies

再点进去这个dependencies往下拉发现下面的properties里面是依赖。他来管理所有的依赖称为spring boot的版本仲裁中心

以后导入依赖默认不需要写版本的因为所有的依赖都已经被dependencies管理

如果有没有被依赖的要写版本号。

2.导入的starter web 依赖,

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

spring bootstarter是场景启动器。

点进去发现里面有很多依赖帮我们导入了web正常运行所需要的依赖组件,

spring boot将所有的功能场景都抽取做成一个个starter,项目中引用starter就可以引入这些依赖,用什么功能导入什么场景启动器。

发布了9 篇原创文章 · 获赞 2 · 访问量 2067

猜你喜欢

转载自blog.csdn.net/whutwwg/article/details/105234793