Create spring-boot-undertow module

This commit is contained in:
Andy Wilkinson
2025-03-13 14:35:24 +00:00
committed by Phillip Webb
parent 0f405e979e
commit 0a72db4676
71 changed files with 172 additions and 118 deletions

View File

@@ -71,6 +71,7 @@ include "spring-boot-project:spring-boot-tools:spring-boot-maven-plugin"
include "spring-boot-project:spring-boot-tools:spring-boot-properties-migrator"
include "spring-boot-project:spring-boot-tools:spring-boot-test-support"
include "spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"
include "spring-boot-project:spring-boot-undertow"
include "spring-boot-system-tests:spring-boot-deployment-tests"
include "spring-boot-system-tests:spring-boot-image-tests"
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests"

View File

@@ -18,6 +18,7 @@ dependencies {
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
optional(project(":spring-boot-project:spring-boot-tomcat"))
optional(project(":spring-boot-project:spring-boot-undertow"))
optional("ch.qos.logback:logback-classic")
optional("org.apache.cassandra:java-driver-core") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"

View File

@@ -19,7 +19,7 @@ package org.springframework.boot.actuate.autoconfigure.web.server.undertow;
import java.util.function.Function;
import org.springframework.boot.actuate.autoconfigure.web.server.AccessLogCustomizer;
import org.springframework.boot.web.server.undertow.ConfigurableUndertowWebServerFactory;
import org.springframework.boot.undertow.ConfigurableUndertowWebServerFactory;
/**
* {@link AccessLogCustomizer} for Undertow.

View File

@@ -25,10 +25,10 @@ import org.springframework.boot.actuate.autoconfigure.web.ManagementContextType;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.autoconfigure.web.server.reactive.undertow.UndertowReactiveWebServerAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.undertow.autoconfigure.reactive.UndertowReactiveWebServerAutoConfiguration;
import org.springframework.boot.undertow.reactive.UndertowReactiveWebServerFactory;
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
import org.springframework.boot.web.server.reactive.undertow.UndertowReactiveWebServerFactory;
import org.springframework.context.annotation.Bean;
/**

View File

@@ -26,7 +26,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.autoconfigure.web.server.reactive.undertow.UndertowReactiveWebServerAutoConfiguration;
import org.springframework.boot.undertow.autoconfigure.reactive.UndertowReactiveWebServerAutoConfiguration;
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
import org.springframework.context.annotation.Bean;

View File

@@ -24,7 +24,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.context.annotation.Bean;
/**

View File

@@ -26,7 +26,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.autoconfigure.web.server.servlet.undertow.UndertowServletWebServerAutoConfiguration;
import org.springframework.boot.undertow.autoconfigure.servlet.UndertowServletWebServerAutoConfiguration;
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;

View File

@@ -24,6 +24,7 @@ dependencies {
dockerTestImplementation("org.testcontainers:testcontainers")
optional(project(":spring-boot-project:spring-boot-tomcat"))
optional(project(":spring-boot-project:spring-boot-undertow"))
optional("org.apache.cassandra:java-driver-core") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}

View File

@@ -27,8 +27,8 @@ import org.apache.catalina.Context;
import org.apache.catalina.core.StandardWrapper;
import org.springframework.boot.tomcat.TomcatWebServer;
import org.springframework.boot.undertow.servlet.UndertowServletWebServer;
import org.springframework.boot.web.server.WebServer;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServer;
import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext;
import org.springframework.util.ClassUtils;
import org.springframework.web.context.WebApplicationContext;
@@ -47,6 +47,10 @@ final class DispatcherServletHandlerMappings {
private static final boolean TOMCAT_WEB_SERVER_PRESENT = ClassUtils.isPresent(
"org.springframework.boot.tomcat.TomcatWebServer", DispatcherServletHandlerMappings.class.getClassLoader());
private static final boolean UNDERTOW_WEB_SERVER_PRESENT = ClassUtils.isPresent(
"org.springframework.boot.undertow.UndertowWebServer",
DispatcherServletHandlerMappings.class.getClassLoader());
private final String name;
private final DispatcherServlet dispatcherServlet;
@@ -74,7 +78,7 @@ final class DispatcherServletHandlerMappings {
return;
}
WebServer webServer = webServerApplicationContext.getWebServer();
if (webServer instanceof UndertowServletWebServer undertowServletWebServer) {
if (UNDERTOW_WEB_SERVER_PRESENT && webServer instanceof UndertowServletWebServer undertowServletWebServer) {
new UndertowServletInitializer(undertowServletWebServer).initializeServlet(this.name);
}
else if (TOMCAT_WEB_SERVER_PRESENT && webServer instanceof TomcatWebServer tomcatWebServer) {

View File

@@ -8,6 +8,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-all"))
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(project(":spring-boot-project:spring-boot-undertow"))
testImplementation("io.projectreactor.netty:reactor-netty-http")
testImplementation("org.apache.httpcomponents.client5:httpclient5")
testImplementation("org.apache.httpcomponents.core5:httpcore5-reactive")

View File

@@ -24,10 +24,10 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.testsupport.classpath.resources.WithResource;
import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories;
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.WebServer;
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
import org.springframework.boot.web.server.servlet.jetty.JettyServletWebServerFactory;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -1,7 +1,6 @@
org.springframework.aot.hint.RuntimeHintsRegistrar=\
org.springframework.boot.http.client.ClientHttpRequestFactoryRuntimeHints,\
org.springframework.boot.jdbc.DataSourceBuilderRuntimeHints,\
org.springframework.boot.web.server.undertow.UndertowWebServer$UndertowWebServerRuntimeHints
org.springframework.boot.jdbc.DataSourceBuilderRuntimeHints
org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=\
org.springframework.boot.jackson.JsonComponentModule$JsonComponentBeanFactoryInitializationAotProcessor

View File

@@ -219,6 +219,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(project(":spring-boot-project:spring-boot-undertow"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
testImplementation("ch.qos.logback:logback-classic")

View File

@@ -65,14 +65,6 @@
"level": "error"
}
},
{
"name": "server.undertow.buffers-per-region",
"type": "java.lang.Integer",
"description": "Number of buffer per region.",
"deprecation": {
"level": "error"
}
},
{
"name": "spring.activemq.pool.create-connection-on-startup",
"type": "java.lang.Boolean",

View File

@@ -134,9 +134,7 @@ org.springframework.boot.autoconfigure.web.reactive.function.client.ClientHttpCo
org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration
org.springframework.boot.autoconfigure.web.server.reactive.jetty.JettyReactiveWebServerAutoConfiguration
org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration
org.springframework.boot.autoconfigure.web.server.reactive.undertow.UndertowReactiveWebServerAutoConfiguration
org.springframework.boot.autoconfigure.web.server.servlet.jetty.JettyServletWebServerAutoConfiguration
org.springframework.boot.autoconfigure.web.server.servlet.undertow.UndertowServletWebServerAutoConfiguration
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration
org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration
org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration

View File

@@ -33,8 +33,8 @@ import org.springframework.boot.testsupport.classpath.ForkedClassPath;
import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories;
import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration;
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.servlet.jetty.JettyServletWebServerFactory;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -2046,7 +2046,8 @@ bom {
"spring-boot-test",
"spring-boot-test-autoconfigure",
"spring-boot-testcontainers",
"spring-boot-tomcat"
"spring-boot-tomcat",
"spring-boot-undertow"
]
plugins = [
"spring-boot-maven-plugin"

View File

@@ -65,6 +65,7 @@ dependencies {
autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-tomcat", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-undertow", configuration: "autoConfigurationMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-actuator", configuration: "configurationPropertiesMetadata"))
@@ -76,6 +77,7 @@ dependencies {
configurationProperties(project(path: ":spring-boot-project:spring-boot-test-autoconfigure", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-tomcat", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-undertow", configuration: "configurationPropertiesMetadata"))
dokkatoo(project(path: ":spring-boot-project:spring-boot-all"))
dokkatoo(project(path: ":spring-boot-project:spring-boot-test"))
@@ -91,6 +93,7 @@ dependencies {
implementation(project(path: ":spring-boot-project:spring-boot-tomcat"))
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-cli"))
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
implementation(project(path: ":spring-boot-project:spring-boot-undertow"))
implementation("ch.qos.logback:logback-classic")
implementation("com.redis:testcontainers-redis")
implementation("com.zaxxer:HikariCP")

View File

@@ -18,8 +18,8 @@ package org.springframework.boot.docs.howto.webserver.enablemultiplelistenersinu
import io.undertow.Undertow.Builder;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -18,8 +18,8 @@ package org.springframework.boot.docs.howto.webserver.enablemultiplelistenersinu
import io.undertow.Undertow
import org.springframework.boot.web.server.WebServerFactoryCustomizer
import org.springframework.boot.web.server.undertow.UndertowBuilderCustomizer
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory
import org.springframework.boot.undertow.UndertowBuilderCustomizer
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

View File

@@ -5,7 +5,7 @@ plugins {
description = "Starter for using Undertow as the embedded servlet container. An alternative to spring-boot-starter-tomcat"
dependencies {
api("io.undertow:undertow-core")
api(project(":spring-boot-project:spring-boot-undertow"))
api("io.undertow:undertow-servlet")
api("io.undertow:undertow-websockets-jsr")
api("org.apache.tomcat.embed:tomcat-embed-el")

View File

@@ -0,0 +1,36 @@
plugins {
id "java-library"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.deployed"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot Undertow"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api("io.undertow:undertow-servlet")
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional("io.undertow:undertow-websockets-jsr")
optional("org.springframework:spring-webflux")
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
testImplementation("org.apache.httpcomponents.client5:httpclient5")
testImplementation("org.apache.tomcat.embed:tomcat-embed-jasper")
testRuntimeOnly("ch.qos.logback:logback-classic")
testRuntimeOnly("io.projectreactor:reactor-test")
testRuntimeOnly("io.projectreactor.netty:reactor-netty-http")
testRuntimeOnly("org.eclipse.jetty:jetty-client")
testRuntimeOnly("org.eclipse.jetty.http2:jetty-http2-client")
testRuntimeOnly("org.eclipse.jetty.http2:jetty-http2-client-transport")
}
test {
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
import java.io.Closeable;
import java.io.File;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
import java.util.ArrayList;
import java.util.List;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
import java.io.File;
import java.util.Collection;

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
import java.io.Closeable;
import io.undertow.server.HttpHandler;
import io.undertow.server.handlers.GracefulShutdownHandler;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServer;
import org.springframework.boot.undertow.servlet.UndertowServletWebServer;
/**
* Factory used by {@link UndertowServletWebServer} to add {@link HttpHandler

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
import java.net.InetAddress;
import java.util.Map;

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
import io.undertow.Undertow.Builder;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
/**
* Callback interface that can be used to customize an Undertow {@link Builder}.

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
import java.io.Closeable;
import java.io.IOException;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
import java.io.File;
import java.net.InetAddress;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.undertow;
package org.springframework.boot.undertow.autoconfigure;
import java.io.File;
import java.nio.charset.Charset;

View File

@@ -14,13 +14,13 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.undertow;
package org.springframework.boot.undertow.autoconfigure;
import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWarDeployment;
import org.springframework.boot.autoconfigure.condition.ConditionalOnThreading;
import org.springframework.boot.autoconfigure.thread.Threading;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.web.server.servlet.undertow.UndertowDeploymentInfoCustomizer;
import org.springframework.boot.undertow.servlet.UndertowDeploymentInfoCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.undertow;
package org.springframework.boot.undertow.autoconfigure;
import java.lang.reflect.Modifier;
import java.nio.charset.Charset;
@@ -30,11 +30,11 @@ import org.xnio.Option;
import org.xnio.Options;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.autoconfigure.web.server.undertow.UndertowServerProperties.Accesslog;
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.boot.context.properties.PropertyMapper;
import org.springframework.boot.undertow.ConfigurableUndertowWebServerFactory;
import org.springframework.boot.undertow.autoconfigure.UndertowServerProperties.Accesslog;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.server.undertow.ConfigurableUndertowWebServerFactory;
import org.springframework.core.Ordered;
import org.springframework.core.env.Environment;
import org.springframework.util.Assert;

View File

@@ -18,4 +18,4 @@
* Classes related to the auto-configuration of a servlet or reactive web server using
* Undertow.
*/
package org.springframework.boot.autoconfigure.web.server.undertow;
package org.springframework.boot.undertow.autoconfigure;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.reactive.undertow;
package org.springframework.boot.undertow.autoconfigure.reactive;
import io.undertow.Undertow;
@@ -25,12 +25,12 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.web.server.reactive.ReactiveWebServerConfiguration;
import org.springframework.boot.autoconfigure.web.server.undertow.UndertowServerProperties;
import org.springframework.boot.autoconfigure.web.server.undertow.UndertowWebServerConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.undertow.autoconfigure.UndertowServerProperties;
import org.springframework.boot.undertow.autoconfigure.UndertowWebServerConfiguration;
import org.springframework.boot.undertow.reactive.UndertowReactiveWebServerFactory;
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
import org.springframework.boot.web.server.reactive.undertow.UndertowReactiveWebServerFactory;
import org.springframework.boot.web.server.undertow.UndertowBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.http.ReactiveHttpInputMessage;

View File

@@ -17,4 +17,4 @@
/**
* Classes related to the auto-configuration of a reactive web server using Undertow.
*/
package org.springframework.boot.autoconfigure.web.server.reactive.undertow;
package org.springframework.boot.undertow.autoconfigure.reactive;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.servlet.undertow;
package org.springframework.boot.undertow.autoconfigure.servlet;
import io.undertow.Undertow;
import io.undertow.websockets.jsr.Bootstrap;
@@ -30,13 +30,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplicat
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.autoconfigure.condition.SearchStrategy;
import org.springframework.boot.autoconfigure.web.server.servlet.ServletWebServerConfiguration;
import org.springframework.boot.autoconfigure.web.server.undertow.UndertowServerProperties;
import org.springframework.boot.autoconfigure.web.server.undertow.UndertowWebServerConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.undertow.autoconfigure.UndertowServerProperties;
import org.springframework.boot.undertow.autoconfigure.UndertowWebServerConfiguration;
import org.springframework.boot.undertow.servlet.UndertowDeploymentInfoCustomizer;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
import org.springframework.boot.web.server.servlet.undertow.UndertowDeploymentInfoCustomizer;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.undertow.UndertowBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.servlet.undertow;
package org.springframework.boot.undertow.autoconfigure.servlet;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.autoconfigure.web.server.undertow.UndertowServerProperties;
import org.springframework.boot.undertow.autoconfigure.UndertowServerProperties;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
/**
* {@link WebServerFactoryCustomizer} to apply {@link ServerProperties} to Undertow

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.servlet.undertow;
package org.springframework.boot.undertow.autoconfigure.servlet;
import io.undertow.servlet.api.DeploymentInfo;
import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
import org.springframework.boot.undertow.servlet.UndertowDeploymentInfoCustomizer;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.server.servlet.undertow.UndertowDeploymentInfoCustomizer;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.core.Ordered;
/**

View File

@@ -17,4 +17,4 @@
/**
* Classes related to the auto-configuration of a servlet web server using Undertow.
*/
package org.springframework.boot.autoconfigure.web.server.servlet.undertow;
package org.springframework.boot.undertow.autoconfigure.servlet;

View File

@@ -17,7 +17,7 @@
/**
* Reactive and servlet web server implementations backed by Undertow.
*
* @see org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory
* @see org.springframework.boot.web.server.reactive.undertow.UndertowReactiveWebServerFactory
* @see org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory
* @see org.springframework.boot.undertow.reactive.UndertowReactiveWebServerFactory
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;

View File

@@ -14,19 +14,19 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.reactive.undertow;
package org.springframework.boot.undertow.reactive;
import java.util.List;
import io.undertow.Undertow;
import org.springframework.boot.undertow.ConfigurableUndertowWebServerFactory;
import org.springframework.boot.undertow.HttpHandlerFactory;
import org.springframework.boot.undertow.UndertowWebServer;
import org.springframework.boot.undertow.UndertowWebServerFactory;
import org.springframework.boot.web.server.WebServer;
import org.springframework.boot.web.server.reactive.ConfigurableReactiveWebServerFactory;
import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory;
import org.springframework.boot.web.server.undertow.ConfigurableUndertowWebServerFactory;
import org.springframework.boot.web.server.undertow.HttpHandlerFactory;
import org.springframework.boot.web.server.undertow.UndertowWebServer;
import org.springframework.boot.web.server.undertow.UndertowWebServerFactory;
import org.springframework.http.server.reactive.UndertowHttpHandlerAdapter;
/**

View File

@@ -17,4 +17,4 @@
/**
* Reactive web server implementation backed by Undertow.
*/
package org.springframework.boot.web.server.reactive.undertow;
package org.springframework.boot.undertow.reactive;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import java.io.IOException;
import java.util.Arrays;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import java.io.Closeable;
import java.io.IOException;
@@ -24,7 +24,7 @@ import io.undertow.server.HttpServerExchange;
import io.undertow.servlet.api.DeploymentManager;
import jakarta.servlet.ServletException;
import org.springframework.boot.web.server.undertow.HttpHandlerFactory;
import org.springframework.boot.undertow.HttpHandlerFactory;
import org.springframework.util.Assert;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import java.io.File;
import java.io.FileInputStream;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import java.io.File;
import java.io.IOException;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import io.undertow.servlet.api.DeploymentInfo;

View File

@@ -14,16 +14,16 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import io.undertow.Handlers;
import io.undertow.Undertow.Builder;
import io.undertow.server.HttpHandler;
import io.undertow.servlet.api.DeploymentManager;
import org.springframework.boot.undertow.HttpHandlerFactory;
import org.springframework.boot.undertow.UndertowWebServer;
import org.springframework.boot.web.server.WebServer;
import org.springframework.boot.web.server.undertow.HttpHandlerFactory;
import org.springframework.boot.web.server.undertow.UndertowWebServer;
import org.springframework.util.StringUtils;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import java.io.File;
import java.io.IOException;
@@ -63,6 +63,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.context.properties.PropertyMapper;
import org.springframework.boot.undertow.HttpHandlerFactory;
import org.springframework.boot.undertow.UndertowWebServerFactory;
import org.springframework.boot.web.server.Cookie.SameSite;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.MimeMappings.Mapping;
@@ -75,8 +77,6 @@ import org.springframework.boot.web.server.servlet.ServletContextInitializer;
import org.springframework.boot.web.server.servlet.ServletContextInitializers;
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
import org.springframework.boot.web.server.servlet.ServletWebServerSettings;
import org.springframework.boot.web.server.undertow.HttpHandlerFactory;
import org.springframework.boot.web.server.undertow.UndertowWebServerFactory;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.Assert;

View File

@@ -17,4 +17,4 @@
/**
* Servlet web server implementation backed by Undertow.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;

View File

@@ -0,0 +1,13 @@
{
"groups": [],
"properties": [
{
"name": "server.undertow.buffers-per-region",
"type": "java.lang.Integer",
"description": "Number of buffer per region.",
"deprecation": {
"level": "error"
}
}
]
}

View File

@@ -0,0 +1,2 @@
org.springframework.aot.hint.RuntimeHintsRegistrar=\
org.springframework.boot.undertow.UndertowWebServer$UndertowWebServerRuntimeHints

View File

@@ -0,0 +1,2 @@
org.springframework.boot.undertow.autoconfigure.reactive.UndertowReactiveWebServerAutoConfiguration
org.springframework.boot.undertow.autoconfigure.servlet.UndertowServletWebServerAutoConfiguration

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
/**
* Helper class to provide public access to package-private methods for testing purposes.

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.undertow;
package org.springframework.boot.undertow;
import java.util.function.Predicate;
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
import org.springframework.boot.web.server.undertow.UndertowWebServer.UndertowWebServerRuntimeHints;
import org.springframework.boot.undertow.UndertowWebServer.UndertowWebServerRuntimeHints;
import org.springframework.util.ReflectionUtils;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.undertow;
package org.springframework.boot.undertow.autoconfigure;
import java.util.Collections;
import java.util.Map;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.undertow;
package org.springframework.boot.undertow.autoconfigure;
import java.io.File;
import java.nio.charset.StandardCharsets;
@@ -33,8 +33,8 @@ import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.context.properties.source.ConfigurationPropertySources;
import org.springframework.boot.web.server.undertow.ConfigurableUndertowWebServerFactory;
import org.springframework.boot.web.server.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.undertow.ConfigurableUndertowWebServerFactory;
import org.springframework.boot.undertow.UndertowBuilderCustomizer;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.test.context.support.TestPropertySourceUtils;
import org.springframework.test.util.ReflectionTestUtils;

View File

@@ -14,16 +14,16 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.reactive.undertow;
package org.springframework.boot.undertow.autoconfigure.reactive;
import io.undertow.Undertow.Builder;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.web.server.reactive.AbstractReactiveWebServerAutoConfigurationTests;
import org.springframework.boot.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.undertow.reactive.UndertowReactiveWebServerFactory;
import org.springframework.boot.undertow.servlet.UndertowDeploymentInfoCustomizer;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.server.reactive.undertow.UndertowReactiveWebServerFactory;
import org.springframework.boot.web.server.servlet.undertow.UndertowDeploymentInfoCustomizer;
import org.springframework.boot.web.server.undertow.UndertowBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.servlet.undertow;
package org.springframework.boot.undertow.autoconfigure.servlet;
import io.undertow.Undertow.Builder;
import io.undertow.servlet.api.DeploymentInfo;
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.web.server.servlet.AbstractServletWebServerAutoConfigurationTests;
import org.springframework.boot.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.undertow.servlet.UndertowDeploymentInfoCustomizer;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.server.servlet.undertow.UndertowDeploymentInfoCustomizer;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.undertow.UndertowBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -43,7 +43,6 @@ import static org.mockito.Mockito.mock;
* @author Raheela Aslam
* @author Madhura Bhave
*/
// @DirtiesUrlFactories
class UndertowServletWebServerAutoConfigurationTests extends AbstractServletWebServerAutoConfigurationTests {
UndertowServletWebServerAutoConfigurationTests() {

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.servlet.undertow;
package org.springframework.boot.undertow.autoconfigure.servlet;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.web.server.undertow.UndertowServerProperties;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.undertow.autoconfigure.UndertowServerProperties;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.server.servlet.undertow;
package org.springframework.boot.undertow.autoconfigure.servlet;
import jakarta.servlet.ServletContextListener;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.servlet.AbstractServletWebServerServletContextListenerTests;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.reactive.undertow;
package org.springframework.boot.undertow.reactive;
import java.io.File;
import java.time.Duration;
@@ -27,12 +27,12 @@ import org.junit.jupiter.api.io.TempDir;
import org.mockito.InOrder;
import reactor.core.publisher.Mono;
import org.springframework.boot.undertow.UndertowAccess;
import org.springframework.boot.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.undertow.UndertowWebServer;
import org.springframework.boot.web.server.Shutdown;
import org.springframework.boot.web.server.reactive.AbstractReactiveWebServerFactoryTests;
import org.springframework.boot.web.server.reactive.ConfigurableReactiveWebServerFactory;
import org.springframework.boot.web.server.undertow.UndertowAccess;
import org.springframework.boot.web.server.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.web.server.undertow.UndertowWebServer;
import org.springframework.http.MediaType;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.web.reactive.function.BodyInserters;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import java.io.File;
import java.util.Date;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import java.io.File;
import java.io.FileOutputStream;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.web.server.servlet.undertow;
package org.springframework.boot.undertow.servlet;
import java.io.File;
import java.io.IOException;
@@ -50,13 +50,13 @@ import org.mockito.InOrder;
import org.springframework.boot.testsupport.classpath.resources.WithPackageResources;
import org.springframework.boot.testsupport.web.servlet.ExampleServlet;
import org.springframework.boot.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.GracefulShutdownResult;
import org.springframework.boot.web.server.PortInUseException;
import org.springframework.boot.web.server.Shutdown;
import org.springframework.boot.web.server.servlet.AbstractServletWebServerFactoryTests;
import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory;
import org.springframework.boot.web.server.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.http.HttpStatus;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;

View File

@@ -36,8 +36,8 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.servlet.ServletWebServerFactory;
import org.springframework.boot.web.server.servlet.undertow.UndertowServletWebServerFactory;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;