Switching to Jetty and Undertow

The following screenshot shows the changes needed in order to switch to using Jetty embedded server:

All that we need to do is exclude the Tomcat starter dependency in spring-boot-starter-web and include a dependency in ;spring-boot-starter-jetty.

You can now see a number of Jetty dependencies in the Maven dependencies section. The following screenshot shows a few of the Jetty-related dependencies:

Switching to Undertow is equally easy. Use spring-boot-starter-undertow instead of spring-boot-starter-jetty:

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.