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:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>