0

I have some Spring Boot 2.1 applications and they are all hosted on Tomcat 8.5 We normally use the following POM.xml structure:

<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> 

The issue we are facing is about the size, we realized that spring-boot-started takes a lot of MB, while we have another application which is using only: spring-boot-starter-web and spring-boot-starter-tomcat and the size jump down from 50MB to 10MB.

Assuming we only use Tomcat, except for development where we use mvn spring-boot run, what happens if I remove spring-boot-starter? Can I have an application with only spring-boot-starter-web and spring-boot-starter-tomcat but still being able to use mvn spring-boot run during development?

1 Answer 1

3

See this answer by ltalhouarne.

spring-boot-starter-web contains spring web dependencies (including spring-boot-starter-tomcat):

spring-boot-starter
jackson
spring-core
spring-mvc
spring-boot-starter-tomcat

Simply including spring-boot-starter-web should be enough.

Sign up to request clarification or add additional context in comments.

1 Comment

Super, I'll do that. It should drastically reduce the .war size

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.