From afa5b12bdba7e68d05dc95ce79cb89dc41eb273c Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 9 Jul 2020 10:36:32 +0100 Subject: [PATCH] Make reactive Jetty auto-config back off without jetty-servlet Fixes gh-22275 --- .../web/reactive/ReactiveWebServerFactoryConfiguration.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryConfiguration.java index e03963cd3d09..6ec994d77666 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import java.util.stream.Collectors; import io.undertow.Undertow; +import org.eclipse.jetty.servlet.ServletHolder; import reactor.netty.http.server.HttpServer; import org.springframework.beans.factory.ObjectProvider; @@ -100,7 +101,7 @@ TomcatReactiveWebServerFactory tomcatReactiveWebServerFactory( @Configuration(proxyBeanMethods = false) @ConditionalOnMissingBean(ReactiveWebServerFactory.class) - @ConditionalOnClass({ org.eclipse.jetty.server.Server.class }) + @ConditionalOnClass({ org.eclipse.jetty.server.Server.class, ServletHolder.class }) static class EmbeddedJetty { @Bean