[英]Tomcat and spring-boot-starter
我有一些Spring Boot 2.1应用程序,它们都托管在Tomcat 8.5上。我们通常使用以下POM.xml结构:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
我们面临的问题是大小,我们意识到spring-boot-started需要大量MB,而我们还有另一个仅使用的应用程序: spring-boot-starter-web
和spring-boot-starter-tomcat
和大小从50MB跳到10MB。
假设我们仅使用Tomcat, 但使用mvn spring-boot run
开发除外,如果我删除spring-boot-starter
会发生什么? 我可以使用仅带有spring-boot-starter-web
和spring-boot-starter-tomcat
的应用程序,但仍可以在开发过程中使用mvn spring-boot run
吗?
见这个答案由ltalhouarne。
spring-boot-starter-web
包含spring web依赖项(包括spring-boot-starter-tomcat
):
spring-boot-starter
jackson
spring-core
spring-mvc
spring-boot-starter-tomcat
仅包含spring-boot-starter-web
就足够了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.