我有一些SpringBoot2.1应用程序,它们都托管在Tomcat8.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启动启动占用了大量MB,而我们有另一个仅使用的应用程序:spring-boot-starter-web
和spring-boot-starter-tomcat
,大小从50 MB下降到10 MB。
假设我们只使用Tomcat,,除了使用mvn spring-boot run
的开发之外,如果我删除了spring-boot-starter
,会发生什么?我可以拥有一个只有spring-boot-starter-web
和spring-boot-starter-tomcat
的应用程序,但仍然能够在开发过程中使用mvn spring-boot run
吗?
发布于 2019-04-02 10:43:49
见意大利this的答复。
spring-boot-starter-web
包含spring依赖项(包括spring-boot-starter-tomcat
):spring-boot-starter
jackson
spring-core
spring-mvc
spring-boot-starter-tomcat
简单地包含spring-boot-starter-web
就足够了。
https://stackoverflow.com/questions/55472726
复制相似问题