According by https://docs.spring.io/spring-boot/docs/2.0.0.M5/reference/html/howto-embedded-web-servers.html and the pom of spring-boot-starter-web: https://search.maven.org/artifact/org.springframework.boot/spring-boot-starter-web/2.4.4/jar. We could replace tomcat by jetty in spring-boot. So why not mark it optional in pom?
Asked
Active
Viewed 137 times
1 Answers
1
If spring-boot-starter-tomcat
was marked as optional, no embedded container would be provided by default and an app using spring-boot-starter-web
would fail to start. Using Tomcat by default is a trade-off between convenience for the majority of users who are happy to use Tomcat and making things every so slightly more complicated for those that want to use Jetty or Undertow.

Andy Wilkinson
- 108,729
- 24
- 257
- 242