2015-03-25 14:33:57 +00:00
|
|
|
|
### 64.11. 使用Undertow替代Tomcat
|
2015-03-23 16:31:21 +00:00
|
|
|
|
|
2015-03-25 14:33:57 +00:00
|
|
|
|
使用Undertow替代Tomcat和[使用Jetty替代Tomcat](https://github.com/qibaoguang/Spring-Boot-Reference-Guide/edit/master/How-to_%20guides.md)非常类似。你需要排除Tomat依赖,并包含Undertow starter。
|
2015-03-23 16:31:21 +00:00
|
|
|
|
|
2015-03-25 14:33:57 +00:00
|
|
|
|
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"
|
|
|
|
|
}
|
2015-03-23 16:31:21 +00:00
|
|
|
|
|
2015-03-25 14:33:57 +00:00
|
|
|
|
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")
|
|
|
|
|
// ...
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
```
|