【发布时间】:2016-06-29 05:47:28
【问题描述】:
我正在使用 Spring-boot 开发一个 Web 应用程序,它运行良好。
我一直在我的浏览器上对其进行编辑和测试,就像它已部署到服务器一样。
但是现在我想生成我的war文件,并且根据Spring's documentation here,我必须将tomcat依赖标记为提供。问题是我在 pom.xml 中的任何地方都看不到这种依赖关系。
问题:我应该将哪个依赖项标记为已提供?
这些是我在 pom.xml 中实际拥有的:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
【问题讨论】:
-
你的 POM 中的 spring-boot-starter-parent 版本是什么?
-
你的答案是正确的,我现在来测试一下。
标签: spring maven tomcat spring-boot maven-dependency