Man*_*oid 15 spring intellij-idea spring-boot
我正在尝试在 IntellIJ 中开发一个基于 Spring Boot 的示例应用程序。所以我使用了 spring Initialzr 方法,并在设置过程中进行了默认选择。我最终得到的 pom.xml 具有以下依赖性:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)
但是我正在关注的教程有以下内容:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)
那么,有什么区别呢?我可以两者兼得吗?
Bra*_*don 18
spring-boot-starter-web 包含以下依赖项:
使用 IntelliJ,您可以在项目结构的底部查看工件的依赖关系。
鉴于 spring-boot-starter 是 spring-boot-starter-web 的一个依赖项,两者兼而有之是没有用的。如果你同时保留两者都不会造成任何伤害,只是没有必要。
spring-boot-starter 为您的应用程序提供基本的开发和运行时基础设施以及核心 spring 功能。如果您希望项目具有诸如 spring-mvc 之类的 Web 功能,则需要使用 spring-boot-starter-web。但是,如果您使用 spring-boot-starter-web,则无需明确提及 spring-boot-starter。
归档时间: |
|
查看次数: |
5645 次 |
最近记录: |