Skip to content

Commit 676387c

Browse files
committed
Create spring-boot-undertow module
1 parent 5dc798a commit 676387c

File tree

69 files changed

+168
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+168
-114
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ include "spring-boot-project:spring-boot-testcontainers"
7171
include "spring-boot-project:spring-boot-test-autoconfigure"
7272
include "spring-boot-project:spring-boot-test-integration-tests"
7373
include "spring-boot-project:spring-boot-tomcat"
74+
include "spring-boot-project:spring-boot-undertow"
7475
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests"
7576
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-launch-script-tests"
7677
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-loader-tests"

spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies {
1818
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
1919

2020
optional(project(":spring-boot-project:spring-boot-tomcat"))
21+
optional(project(":spring-boot-project:spring-boot-undertow"))
2122
optional("ch.qos.logback:logback-classic")
2223
optional("org.apache.cassandra:java-driver-core") {
2324
exclude group: "org.slf4j", module: "jcl-over-slf4j"

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/undertow/UndertowAccessLogCustomizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import java.util.function.Function;
2020

2121
import org.springframework.boot.actuate.autoconfigure.web.server.AccessLogCustomizer;
22-
import org.springframework.boot.web.server.undertow.ConfigurableUndertowWebServerFactory;
22+
import org.springframework.boot.undertow.ConfigurableUndertowWebServerFactory;
2323

2424
/**
2525
* {@link AccessLogCustomizer} for Undertow.

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/undertow/UndertowReactiveManagementChildContextConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
28-
import org.springframework.boot.autoconfigure.web.server.reactive.undertow.UndertowReactiveWebServerAutoConfiguration;
2928
import org.springframework.boot.context.properties.EnableConfigurationProperties;
29+
import org.springframework.boot.undertow.reactive.UndertowReactiveWebServerFactory;
30+
import org.springframework.boot.undertow.reactive.autoconfigure.UndertowReactiveWebServerAutoConfiguration;
3031
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
31-
import org.springframework.boot.web.server.reactive.undertow.UndertowReactiveWebServerFactory;
3232
import org.springframework.context.annotation.Bean;
3333

3434
/**

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/undertow/UndertowReactiveManagementContextAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
29-
import org.springframework.boot.autoconfigure.web.server.reactive.undertow.UndertowReactiveWebServerAutoConfiguration;
29+
import org.springframework.boot.undertow.reactive.autoconfigure.UndertowReactiveWebServerAutoConfiguration;
3030
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
3131
import org.springframework.context.annotation.Bean;
3232

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/undertow/UndertowServletManagementChildContextConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
2626
import org.springframework.boot.context.properties.EnableConfigurationProperties;
27-
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
27+
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
2828
import org.springframework.context.annotation.Bean;
2929

3030
/**

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/undertow/UndertowServletManagementContextAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
29-
import org.springframework.boot.autoconfigure.web.server.servlet.undertow.UndertowServletWebServerAutoConfiguration;
29+
import org.springframework.boot.undertow.servlet.autoconfigure.UndertowServletWebServerAutoConfiguration;
3030
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
3131
import org.springframework.context.annotation.Bean;
3232

spring-boot-project/spring-boot-actuator/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies {
2424
dockerTestImplementation("org.testcontainers:testcontainers")
2525

2626
optional(project(":spring-boot-project:spring-boot-tomcat"))
27+
optional(project(":spring-boot-project:spring-boot-undertow"))
2728
optional("org.apache.cassandra:java-driver-core") {
2829
exclude group: "org.slf4j", module: "jcl-over-slf4j"
2930
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import org.apache.catalina.core.StandardWrapper;
2828

2929
import org.springframework.boot.tomcat.TomcatWebServer;
30+
import org.springframework.boot.undertow.servlet.UndertowServletWebServer;
3031
import org.springframework.boot.web.server.WebServer;
31-
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServer;
3232
import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext;
3333
import org.springframework.util.ClassUtils;
3434
import org.springframework.web.context.WebApplicationContext;
@@ -47,6 +47,10 @@ final class DispatcherServletHandlerMappings {
4747
private static final boolean TOMCAT_WEB_SERVER_PRESENT = ClassUtils.isPresent(
4848
"org.springframework.boot.tomcat.TomcatWebServer", DispatcherServletHandlerMappings.class.getClassLoader());
4949

50+
private static final boolean UNDERTOW_WEB_SERVER_PRESENT = ClassUtils.isPresent(
51+
"org.springframework.boot.undertow.UndertowWebServer",
52+
DispatcherServletHandlerMappings.class.getClassLoader());
53+
5054
private final String name;
5155

5256
private final DispatcherServlet dispatcherServlet;
@@ -74,7 +78,7 @@ private void initializeDispatcherServletIfPossible() {
7478
return;
7579
}
7680
WebServer webServer = webServerApplicationContext.getWebServer();
77-
if (webServer instanceof UndertowServletWebServer undertowServletWebServer) {
81+
if (UNDERTOW_WEB_SERVER_PRESENT && webServer instanceof UndertowServletWebServer undertowServletWebServer) {
7882
new UndertowServletInitializer(undertowServletWebServer).initializeServlet(this.name);
7983
}
8084
else if (TOMCAT_WEB_SERVER_PRESENT && webServer instanceof TomcatWebServer tomcatWebServer) {

spring-boot-project/spring-boot-all-integration-tests/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies {
88
testImplementation(project(":spring-boot-project:spring-boot-all"))
99
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
1010
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
11+
testImplementation(project(":spring-boot-project:spring-boot-undertow"))
1112
testImplementation("io.projectreactor.netty:reactor-netty-http")
1213
testImplementation("org.apache.httpcomponents.client5:httpclient5")
1314
testImplementation("org.assertj:assertj-core")

0 commit comments

Comments
 (0)