多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 70.13 使用Undertow替代Tomcat 使用Undertow替代Tomcat和[使用Jetty替代Tomcat](https://github.com/cwiki-us-spring-guides/Spring-Boot-Reference-Guide/tree/0047aa8098a650dde0c93f4d2e91754c83468c4b/IX.%20‘How-to’%20guides/70.11%20Use%20Jetty%20instead%20of%20Tomcat.md)非常类似。你需要排除Tomat依赖,并包含Undertow starter。 Maven示例: ```markup <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> </dependency> ``` Gradle示例: ```text configurations { compile.exclude module: "spring-boot-starter-tomcat" } dependencies { compile 'org.springframework.boot:spring-boot-starter-web:1.3.0.BUILD-SNAPSHOT") compile 'org.springframework.boot:spring-boot-starter-undertow:1.3.0.BUILD-SNAPSHOT") // ... } ```