kevinissun
kevinissun

Reputation: 21

why spring-boot-starter-tomcat is not optional in spring-boot?

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?

Upvotes: 0

Views: 188

Answers (1)

Andy Wilkinson
Andy Wilkinson

Reputation: 116091

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.

Upvotes: 1

Related Questions