簡體   English   中英

Tomcat和spring-boot-starter

[英]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-webspring-boot-starter-tomcat和大小從50MB跳到10MB。

假設我們僅使用Tomcat, 使用mvn spring-boot run 開發除外,如果我刪除spring-boot-starter會發生什么? 我可以使用僅帶有spring-boot-starter-webspring-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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM