我正在开发一个使用Spring 2和反应性启动器的反应性项目。我的问题是,当我启动应用程序时,Tomcat服务器已经启动,而不是Netty。
下面是build.gradle文件中的依赖项任务:
dependencies {
compile("org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-webflux:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-hateoas:${springBootVersion}")
compile group: 'com.github.tomakehurst', name: 'wiremock', version: '2.15.0'
compile("ro.orange.omoney:lms-token-client:0.1.0-SNAPSHOT")
testCompile("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")
}
你能告诉我为什么我要面对这个问题吗?谢谢!
发布于 2018-04-03 07:00:22
您的项目依赖于spring-boot-starter-hateoas
,后者依赖于spring-boot-starter-web
,后者依赖于spring-boot-starter-tomcat
。最后一个依赖项导致Tomcat被配置为运行应用程序。
通常,您必须明确地排除spring-boot-starter-web
,以绕过Tomcat的自动配置。
不过,在这种特殊情况下,我认为这不会有帮助,因为spring-boot-starter-hateoas
项目还不支持反应性堆栈上的web (在SpringBoot2.0.0.RELEASE中)。
目前看来,这要么是HATEOAS,要么是反应性网络。
有关更多详细信息,请参阅HATEOAS on Spring Flux/Mono response。
https://stackoverflow.com/questions/49607828
复制