Spring Boot场景启动器(Starter)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq78442761/article/details/88087210

如下的项目:

目录结构如下:

看porn.xml:

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.5.19.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>

按住spring-boot-starter-parent,鼠标Ctrl + 鼠标左键:

发现他的父类为:

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-dependencies</artifactId>
		<version>1.5.19.RELEASE</version>
		<relativePath>../../spring-boot-dependencies</relativePath>
	</parent>

按住spring-boot-dependencies,鼠标Ctrl + 鼠标左键:

这里有很多properties:

在pron.xml中:

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

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

根据这个dependencies,可以进行添加:

spring-boot-starter:spring-boot场景启动器;帮我们导入了web模块正常运行所依赖的组建!

starter相关场景的所有依赖都会被导入进来。要什么功能就导入什么场景的启动器!

猜你喜欢

转载自blog.csdn.net/qq78442761/article/details/88087210