企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
### 70.13 使用Undertow替代Tomcat 使用Undertow替代Tomcat和[使用Jetty替代Tomcat](333352)非常类似。你需要排除Tomat依赖,并包含Undertow starter。 Maven示例: ```xml <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示例: ```gradle 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") // ... } ```