From b537461d451ba584d33af5467403e3e4571aadb0 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 27 May 2025 16:53:27 +0100 Subject: [PATCH] Move Reactor Netty management server support to s-b-reactor-netty --- .../build.gradle | 2 +- ...ot.autoconfigure.AutoConfiguration.imports | 1 - ...ndpointAdditionalPathIntegrationTests.java | 2 +- .../spring-boot-reactor-netty/build.gradle | 2 +- .../server/reactive/netty/package-info.java | 20 ------------------- ...veManagementChildContextConfiguration.java | 2 +- ...iveManagementContextAutoConfiguration.java | 4 ++-- .../web/server}/package-info.java | 4 ++-- ...web.ManagementContextConfiguration.imports | 1 + ...ot.autoconfigure.AutoConfiguration.imports | 1 + 10 files changed, 10 insertions(+), 29 deletions(-) delete mode 100644 spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/package-info.java rename spring-boot-project/{spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server}/NettyReactiveManagementChildContextConfiguration.java (96%) rename spring-boot-project/{spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server}/NettyReactiveManagementContextAutoConfiguration.java (93%) rename spring-boot-project/{spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server}/package-info.java (81%) create mode 100644 spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure-all/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure-all/build.gradle index 563693cef7..b1ea60e154 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure-all/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure-all/build.gradle @@ -40,7 +40,6 @@ dependencies { optional(project(":spring-boot-project:spring-boot-kafka")) optional(project(":spring-boot-project:spring-boot-metrics")) optional(project(":spring-boot-project:spring-boot-r2dbc")) - optional(project(":spring-boot-project:spring-boot-reactor-netty")) optional(project(":spring-boot-project:spring-boot-restclient")) optional(project(":spring-boot-project:spring-boot-security-oauth2-client")) optional(project(":spring-boot-project:spring-boot-security-oauth2-resource-server")) @@ -130,6 +129,7 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-data-rest")) testImplementation(project(":spring-boot-project:spring-boot-hateoas")) + testImplementation(project(":spring-boot-project:spring-boot-reactor-netty")) testImplementation(project(":spring-boot-project:spring-boot-restclient-test")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 523aeba5ef..70d975d5d2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -66,5 +66,4 @@ org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinTracingAutoC org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesAutoConfiguration org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesEndpointAutoConfiguration org.springframework.boot.actuate.autoconfigure.web.mappings.MappingsEndpointAutoConfiguration -org.springframework.boot.actuate.autoconfigure.web.server.netty.NettyReactiveManagementContextAutoConfiguration org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementContextAutoConfiguration \ No newline at end of file diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java index de351b3f7e..f067a03891 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java @@ -22,10 +22,10 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAu import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.web.server.netty.NettyReactiveManagementContextAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.http.codec.autoconfigure.CodecsAutoConfiguration; import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; +import org.springframework.boot.reactor.netty.actuate.autoconfigure.web.server.NettyReactiveManagementContextAutoConfiguration; import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; diff --git a/spring-boot-project/spring-boot-reactor-netty/build.gradle b/spring-boot-project/spring-boot-reactor-netty/build.gradle index 567d1c9b6d..4aaeb7b343 100644 --- a/spring-boot-project/spring-boot-reactor-netty/build.gradle +++ b/spring-boot-project/spring-boot-reactor-netty/build.gradle @@ -15,7 +15,7 @@ dependencies { implementation(project(":spring-boot-project:spring-boot-netty")) - optional(project(":spring-boot-project:spring-boot-autoconfigure")) + optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) optional(project(":spring-boot-project:spring-boot-autoconfigure")) testImplementation(project(":spring-boot-project:spring-boot-test")) diff --git a/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/package-info.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/package-info.java deleted file mode 100644 index e9c76b9226..0000000000 --- a/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Classes related to the auto-configuration of a reactive web server using Netty. - */ -package org.springframework.boot.autoconfigure.web.server.reactive.netty; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementChildContextConfiguration.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server/NettyReactiveManagementChildContextConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementChildContextConfiguration.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server/NettyReactiveManagementChildContextConfiguration.java index ae9cc27442..db8c5830b9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server/NettyReactiveManagementChildContextConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.web.server.netty; +package org.springframework.boot.reactor.netty.actuate.autoconfigure.web.server; import reactor.netty.http.server.HttpServer; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementContextAutoConfiguration.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server/NettyReactiveManagementContextAutoConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementContextAutoConfiguration.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server/NettyReactiveManagementContextAutoConfiguration.java index dcbc932e6d..3544266240 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementContextAutoConfiguration.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server/NettyReactiveManagementContextAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.web.server.netty; +package org.springframework.boot.reactor.netty.actuate.autoconfigure.web.server; import reactor.netty.http.server.HttpServer; @@ -37,7 +37,7 @@ import org.springframework.context.annotation.Bean; * @since 4.0.0 */ @AutoConfiguration -@ConditionalOnClass(HttpServer.class) +@ConditionalOnClass({ HttpServer.class, ManagementContextFactory.class }) @ConditionalOnWebApplication(type = Type.REACTIVE) @ConditionalOnManagementPort(ManagementPortType.DIFFERENT) public class NettyReactiveManagementContextAutoConfiguration { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/package-info.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server/package-info.java similarity index 81% rename from spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/package-info.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server/package-info.java index 63e0384984..da2e4e5c38 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/package-info.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/actuate/autoconfigure/web/server/package-info.java @@ -15,6 +15,6 @@ */ /** - * Actuator Netty web server support. + * Auto-configuration for a Reactor Netty based management server. */ -package org.springframework.boot.actuate.autoconfigure.web.server.netty; +package org.springframework.boot.reactor.netty.actuate.autoconfigure.web.server; diff --git a/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports b/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports new file mode 100644 index 0000000000..2430ae52ec --- /dev/null +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports @@ -0,0 +1 @@ +org.springframework.boot.reactor.netty.actuate.autoconfigure.web.server.NettyReactiveManagementChildContextConfiguration diff --git a/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 833645211d..b3ea11e1bd 100644 --- a/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1,2 @@ +org.springframework.boot.reactor.netty.actuate.autoconfigure.web.server.NettyReactiveManagementContextAutoConfiguration org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration