From 2a6c81ec0aa3b7a4b415f84bc58d96445d63fd68 Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Thu, 3 Aug 2023 10:48:28 -0300 Subject: [PATCH] Annotate auto-configurations with @AutoConfiguration technical debt: annotate auto configuration classes with spring-boot's `@AutoConfiguration` instead of spring's `@Configuration`. `@AutoConfiguration` was introduced in 2.7 with the idea to mark all auto-configurations with its dedicated annotation and move away from spring.factories for auto-configuration imports in 3.0 as described in this [Github issue](https://github.com/spring-projects/spring-boot/issues/29698). --- .../web/core/WebUIApplicationAutoConfiguration.java | 6 ++---- .../geoserver/cloud/wfs/config/WfsAutoConfiguration.java | 6 ++---- .../wms/WmsApplicationAutoConfiguration.java | 6 ++---- .../CatalogClientBackendAutoConfiguration.java | 6 ++---- .../core/DefaultUpdateSequenceAutoConfiguration.java | 4 ++-- .../backend/core/GeoServerBackendAutoConfiguration.java | 9 +++------ ...RemoteEventResourcePoolCleaupUpAutoConfiguration.java | 4 ++-- .../core/XstreamServiceLoadersAutoConfiguration.java | 4 ++-- .../geotools/GeoToolsHttpClientAutoConfiguration.java | 4 ++-- .../metrics/catalog/CatalogMetricsAutoConfiguration.java | 7 +++---- .../security/GeoServerSecurityAutoConfiguration.java | 5 ++--- .../backend/datadir/DataDirectoryAutoConfiguration.java | 6 ++---- .../RemoteEventDataDirectoryAutoConfiguration.java | 4 ++-- .../backend/jdbcconfig/JDBCConfigAutoConfiguration.java | 6 ++---- .../jdbcconfig/JDBCConfigWebAutoConfiguration.java | 2 ++ .../catalog/cache/BackendCacheAutoConfiguration.java | 4 ++-- .../bus/GeoServerBusIntegrationAutoConfiguration.java | 3 ++- .../event/LocalCatalogEventsAutoConfiguration.java | 4 ++-- .../event/UpdateSequenceControllerAutoConfiguration.java | 4 ++-- .../GeoServerJacksonBindingsAutoConfiguration.java | 6 ++---- .../GeoToolsJacksonBindingsAutoConfiguration.java | 4 ++-- .../gwc/blobstore/AzureBlobstoreAutoConfiguration.java | 3 ++- .../gwc/blobstore/S3BlobstoreAutoConfiguration.java | 3 ++- .../core/CacheSeedingWebMapServiceAutoConfiguration.java | 3 ++- .../gwc/core/GeoWebCacheAutoConfiguration.java | 6 ++---- .../gwc/core/GeoWebCacheEventsAutoConfiguration.java | 4 ++-- .../GeoWebCacheRemoteEventsAutoConfiguration.java | 6 ++---- .../gwc/integration/WMSIntegrationAutoConfiguration.java | 3 ++- .../integration/WMTSIntegrationAutoConfiguration.java | 4 ++-- .../gwc/service/GoogleMapsAutoConfiguration.java | 4 ++-- .../autoconfigure/gwc/service/KMLAutoConfiguration.java | 4 ++-- .../gwc/service/MGMapsAutoConfiguration.java | 4 ++-- .../gwc/service/RESTConfigAutoConfiguration.java | 4 ++-- .../gwc/service/TileMapServiceAutoConfiguration.java | 4 ++-- .../gwc/service/WebMapServiceAutoConfiguration.java | 4 ++-- .../gwc/service/WebMapTileServiceAutoConfiguration.java | 4 ++-- .../web/gwc/GeoWebCacheUIAutoConfiguration.java | 4 ++-- .../jndidatasource/JNDIDataSourceAutoConfiguration.java | 6 +++--- src/library/spring-factory/pom.xml | 8 ++------ ...ilteringXmlBeanDefinitionReaderAutoConfiguration.java | 4 ++-- .../cloud/autoconfigure/cog/COGAutoConfiguration.java | 4 ++-- .../pgraster/PostgisRasterWebUIAutoConfiguration.java | 4 ++-- .../core/ReactiveGeoServerMainAutoConfiguration.java | 6 ++---- .../autoconfigure/authzn/AuthKeyAutoConfiguration.java | 3 ++- .../cloud/app/StartupLoggerAutoConfiguration.java | 4 ++-- .../core/GeoServerWebMvcMainAutoConfiguration.java | 6 ++---- .../GeoServerServletContextAutoConfiguration.java | 7 +++---- .../config/main/GeoServerMainModuleConfiguration.java | 2 +- 48 files changed, 99 insertions(+), 123 deletions(-) diff --git a/src/apps/geoserver/webui/src/main/java/org/geoserver/cloud/autoconfigure/web/core/WebUIApplicationAutoConfiguration.java b/src/apps/geoserver/webui/src/main/java/org/geoserver/cloud/autoconfigure/web/core/WebUIApplicationAutoConfiguration.java index bda35f218..830964273 100644 --- a/src/apps/geoserver/webui/src/main/java/org/geoserver/cloud/autoconfigure/web/core/WebUIApplicationAutoConfiguration.java +++ b/src/apps/geoserver/webui/src/main/java/org/geoserver/cloud/autoconfigure/web/core/WebUIApplicationAutoConfiguration.java @@ -19,15 +19,13 @@ import org.geoserver.config.GeoServerInfo; import org.geoserver.config.GeoServerInfo.WebUIMode; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Import; import org.springframework.core.env.Environment; import javax.annotation.PostConstruct; -@Configuration -@AutoConfigureAfter({GeoServerWebMvcMainAutoConfiguration.class}) +@AutoConfiguration(after = {GeoServerWebMvcMainAutoConfiguration.class}) @Import({ // WebCoreConfiguration.class, // this one is mandatory SecurityAutoConfiguration.class, diff --git a/src/apps/geoserver/wfs/src/main/java/org/geoserver/cloud/wfs/config/WfsAutoConfiguration.java b/src/apps/geoserver/wfs/src/main/java/org/geoserver/cloud/wfs/config/WfsAutoConfiguration.java index edb3f3633..e17a951b9 100644 --- a/src/apps/geoserver/wfs/src/main/java/org/geoserver/cloud/wfs/config/WfsAutoConfiguration.java +++ b/src/apps/geoserver/wfs/src/main/java/org/geoserver/cloud/wfs/config/WfsAutoConfiguration.java @@ -7,13 +7,11 @@ import org.geoserver.cloud.autoconfigure.core.GeoServerWebMvcMainAutoConfiguration; import org.geoserver.cloud.config.factory.FilteringXmlBeanDefinitionReader; import org.geoserver.cloud.virtualservice.VirtualServiceVerifier; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; -@Configuration(proxyBeanMethods = true) -@AutoConfigureAfter({GeoServerWebMvcMainAutoConfiguration.class}) +@AutoConfiguration(after = GeoServerWebMvcMainAutoConfiguration.class) @ImportResource( // reader = FilteringXmlBeanDefinitionReader.class, // locations = { diff --git a/src/apps/geoserver/wms/src/main/java/org/geoserver/cloud/autoconfigure/wms/WmsApplicationAutoConfiguration.java b/src/apps/geoserver/wms/src/main/java/org/geoserver/cloud/autoconfigure/wms/WmsApplicationAutoConfiguration.java index a6cdfbf9b..65c0b5b05 100644 --- a/src/apps/geoserver/wms/src/main/java/org/geoserver/cloud/autoconfigure/wms/WmsApplicationAutoConfiguration.java +++ b/src/apps/geoserver/wms/src/main/java/org/geoserver/cloud/autoconfigure/wms/WmsApplicationAutoConfiguration.java @@ -19,16 +19,14 @@ import org.geoserver.wms.capabilities.LegendSample; import org.geoserver.wms.capabilities.LegendSampleImpl; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; -@Configuration // auto-configure before GWC's wms-integration to avoid it precluding to load beans from // jar:gs-wms-.* -@AutoConfigureBefore(WMSIntegrationAutoConfiguration.class) +@AutoConfiguration(before = WMSIntegrationAutoConfiguration.class) @ImportResource( // reader = FilteringXmlBeanDefinitionReader.class, // locations = { // diff --git a/src/catalog/backends/catalog-service/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/catalogservice/CatalogClientBackendAutoConfiguration.java b/src/catalog/backends/catalog-service/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/catalogservice/CatalogClientBackendAutoConfiguration.java index d4e9d923f..00c3631b5 100644 --- a/src/catalog/backends/catalog-service/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/catalogservice/CatalogClientBackendAutoConfiguration.java +++ b/src/catalog/backends/catalog-service/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/catalogservice/CatalogClientBackendAutoConfiguration.java @@ -7,9 +7,8 @@ import org.geoserver.cloud.autoconfigure.catalog.backend.core.DefaultUpdateSequenceAutoConfiguration; import org.geoserver.cloud.config.catalog.backend.catalogservice.CatalogClientBackendConfigurer; import org.geoserver.cloud.config.catalog.backend.core.GeoServerBackendConfigurer; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** @@ -22,8 +21,7 @@ * * @see ConditionalOnCatalogServiceClientEnabled */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration(before = DefaultUpdateSequenceAutoConfiguration.class) @ConditionalOnCatalogServiceClientEnabled @Import(CatalogClientBackendConfigurer.class) -@AutoConfigureBefore(DefaultUpdateSequenceAutoConfiguration.class) public class CatalogClientBackendAutoConfiguration {} diff --git a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/DefaultUpdateSequenceAutoConfiguration.java b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/DefaultUpdateSequenceAutoConfiguration.java index 9caa63fec..c7aa3f5ee 100644 --- a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/DefaultUpdateSequenceAutoConfiguration.java +++ b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/DefaultUpdateSequenceAutoConfiguration.java @@ -6,12 +6,12 @@ import org.geoserver.platform.config.DefaultUpdateSequence; import org.geoserver.platform.config.UpdateSequence; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; +@AutoConfiguration @ConditionalOnMissingBean(UpdateSequence.class) -@Configuration public class DefaultUpdateSequenceAutoConfiguration { @Bean UpdateSequence defaultUpdateSequence() { diff --git a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/GeoServerBackendAutoConfiguration.java b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/GeoServerBackendAutoConfiguration.java index 66239e860..364a51f0a 100644 --- a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/GeoServerBackendAutoConfiguration.java +++ b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/GeoServerBackendAutoConfiguration.java @@ -7,8 +7,8 @@ import org.geoserver.cloud.autoconfigure.geotools.GeoToolsHttpClientAutoConfiguration; import org.geoserver.cloud.config.catalog.backend.core.CoreBackendConfiguration; import org.geoserver.cloud.config.jndidatasource.JNDIDataSourceAutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** @@ -22,10 +22,7 @@ * * @see CoreBackendConfiguration */ -@Configuration(proxyBeanMethods = false) -@AutoConfigureAfter({ - GeoToolsHttpClientAutoConfiguration.class, - JNDIDataSourceAutoConfiguration.class -}) +@AutoConfiguration( + after = {GeoToolsHttpClientAutoConfiguration.class, JNDIDataSourceAutoConfiguration.class}) @Import(CoreBackendConfiguration.class) public class GeoServerBackendAutoConfiguration {} diff --git a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/RemoteEventResourcePoolCleaupUpAutoConfiguration.java b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/RemoteEventResourcePoolCleaupUpAutoConfiguration.java index e54303d5c..399ec18b9 100644 --- a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/RemoteEventResourcePoolCleaupUpAutoConfiguration.java +++ b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/RemoteEventResourcePoolCleaupUpAutoConfiguration.java @@ -10,16 +10,16 @@ import org.geoserver.cloud.event.info.InfoEvent; import org.geoserver.cloud.event.remote.resourcepool.RemoteEventResourcePoolProcessor; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * Cleans up cached {@link ResourcePool} entries upon remote Catalog events * * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass(InfoEvent.class) @ConditionalOnCatalogEvents public class RemoteEventResourcePoolCleaupUpAutoConfiguration { diff --git a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/XstreamServiceLoadersAutoConfiguration.java b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/XstreamServiceLoadersAutoConfiguration.java index 10f1eccc7..e2b236380 100644 --- a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/XstreamServiceLoadersAutoConfiguration.java +++ b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/core/XstreamServiceLoadersAutoConfiguration.java @@ -18,9 +18,9 @@ import org.geoserver.wms.WMSXStreamLoader; import org.geoserver.wps.WPSFactoryExtension; import org.geoserver.wps.WPSXStreamLoader; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * Configuration to make sure all {@link XStreamServiceLoader} extensions are loaded regardless of @@ -28,7 +28,7 @@ * * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @Slf4j(topic = "org.geoserver.cloud.config.catalog") public class XstreamServiceLoadersAutoConfiguration { diff --git a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/geotools/GeoToolsHttpClientAutoConfiguration.java b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/geotools/GeoToolsHttpClientAutoConfiguration.java index 4da259382..c9d05e1c2 100644 --- a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/geotools/GeoToolsHttpClientAutoConfiguration.java +++ b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/geotools/GeoToolsHttpClientAutoConfiguration.java @@ -9,11 +9,11 @@ import org.geoserver.cloud.autoconfigure.geotools.GeoToolsHttpClientProxyConfigurationProperties.ProxyHostConfig; import org.geotools.http.HTTPClientFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * {@link EnableAutoConfiguration @EnableAutoConfiguration} auto configuration for a GeoTools {@link @@ -66,7 +66,7 @@ * * */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @EnableConfigurationProperties(GeoToolsHttpClientProxyConfigurationProperties.class) @ConditionalOnProperty( name = "geotools.httpclient.proxy.enabled", diff --git a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/metrics/catalog/CatalogMetricsAutoConfiguration.java b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/metrics/catalog/CatalogMetricsAutoConfiguration.java index 53a417244..6038a2f26 100644 --- a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/metrics/catalog/CatalogMetricsAutoConfiguration.java +++ b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/metrics/catalog/CatalogMetricsAutoConfiguration.java @@ -12,11 +12,10 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * {@link EnableAutoConfiguration Auto-configuration} for {@link Catalog} and {@link GeoServer} @@ -25,8 +24,8 @@ * @see CatalogMetrics * @since 1.0 */ -@Configuration(proxyBeanMethods = false) -@AutoConfigureAfter({MetricsAutoConfiguration.class, CompositeMeterRegistryAutoConfiguration.class}) +@AutoConfiguration( + after = {MetricsAutoConfiguration.class, CompositeMeterRegistryAutoConfiguration.class}) @ConditionalOnGeoServerMetricsEnabled @EnableConfigurationProperties(GeoSeverMetricsConfigProperties.class) public class CatalogMetricsAutoConfiguration { diff --git a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/security/GeoServerSecurityAutoConfiguration.java b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/security/GeoServerSecurityAutoConfiguration.java index 16d331071..a2c09fc8f 100644 --- a/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/security/GeoServerSecurityAutoConfiguration.java +++ b/src/catalog/backends/common/src/main/java/org/geoserver/cloud/autoconfigure/security/GeoServerSecurityAutoConfiguration.java @@ -11,7 +11,7 @@ import org.geoserver.cloud.security.GeoServerSecurityConfiguration; import org.geoserver.config.util.XStreamPersisterFactory; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -20,8 +20,7 @@ import javax.annotation.PostConstruct; -@Configuration -@AutoConfigureAfter(GeoServerBackendAutoConfiguration.class) +@AutoConfiguration(after = GeoServerBackendAutoConfiguration.class) @Import({ GeoServerSecurityAutoConfiguration.Enabled.class, GeoServerSecurityAutoConfiguration.Disabled.class diff --git a/src/catalog/backends/datadir/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/datadir/DataDirectoryAutoConfiguration.java b/src/catalog/backends/datadir/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/datadir/DataDirectoryAutoConfiguration.java index 9d4728f3c..764ef4d8f 100644 --- a/src/catalog/backends/datadir/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/datadir/DataDirectoryAutoConfiguration.java +++ b/src/catalog/backends/datadir/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/datadir/DataDirectoryAutoConfiguration.java @@ -6,12 +6,10 @@ import org.geoserver.cloud.autoconfigure.catalog.backend.core.DefaultUpdateSequenceAutoConfiguration; import org.geoserver.cloud.config.catalog.backend.datadirectory.DataDirectoryBackendConfiguration; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Import; -@Configuration(proxyBeanMethods = false) +@AutoConfiguration(before = DefaultUpdateSequenceAutoConfiguration.class) @ConditionalOnDataDirectoryEnabled @Import(DataDirectoryBackendConfiguration.class) -@AutoConfigureBefore(DefaultUpdateSequenceAutoConfiguration.class) public class DataDirectoryAutoConfiguration {} diff --git a/src/catalog/backends/datadir/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/datadir/RemoteEventDataDirectoryAutoConfiguration.java b/src/catalog/backends/datadir/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/datadir/RemoteEventDataDirectoryAutoConfiguration.java index 06fe7a833..bb78c6d61 100644 --- a/src/catalog/backends/datadir/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/datadir/RemoteEventDataDirectoryAutoConfiguration.java +++ b/src/catalog/backends/datadir/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/datadir/RemoteEventDataDirectoryAutoConfiguration.java @@ -9,10 +9,10 @@ import org.geoserver.cloud.event.remote.datadir.RemoteEventDataDirectoryProcessor; import org.geoserver.config.plugin.RepositoryGeoServerFacade; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnDataDirectoryEnabled @ConditionalOnCatalogEvents public class RemoteEventDataDirectoryAutoConfiguration { diff --git a/src/catalog/backends/jdbcconfig/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigAutoConfiguration.java b/src/catalog/backends/jdbcconfig/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigAutoConfiguration.java index ba21ce91a..c1d7f828e 100644 --- a/src/catalog/backends/jdbcconfig/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigAutoConfiguration.java +++ b/src/catalog/backends/jdbcconfig/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigAutoConfiguration.java @@ -6,12 +6,10 @@ import org.geoserver.cloud.autoconfigure.catalog.backend.core.DefaultUpdateSequenceAutoConfiguration; import org.geoserver.cloud.config.catalog.backend.jdbcconfig.JDBCConfigBackendConfigurer; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Import; -@Configuration(proxyBeanMethods = false) +@AutoConfiguration(before = DefaultUpdateSequenceAutoConfiguration.class) @ConditionalOnJdbcConfigEnabled @Import(JDBCConfigBackendConfigurer.class) -@AutoConfigureBefore(DefaultUpdateSequenceAutoConfiguration.class) public class JDBCConfigAutoConfiguration {} diff --git a/src/catalog/backends/jdbcconfig/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigWebAutoConfiguration.java b/src/catalog/backends/jdbcconfig/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigWebAutoConfiguration.java index 6c958cac9..f535ff8a3 100644 --- a/src/catalog/backends/jdbcconfig/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigWebAutoConfiguration.java +++ b/src/catalog/backends/jdbcconfig/src/main/java/org/geoserver/cloud/autoconfigure/catalog/backend/jdbcconfig/JDBCConfigWebAutoConfiguration.java @@ -5,9 +5,11 @@ package org.geoserver.cloud.autoconfigure.catalog.backend.jdbcconfig; import org.geoserver.cloud.config.catalog.backend.jdbcconfig.JDBCConfigWebConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Import; /** Auto configuration for the wicket ui components of the jdbcconfig extension */ +@AutoConfiguration @ConditionalOnJdbcConfigWebUIEnabled @Import({JDBCConfigWebConfiguration.class}) public class JDBCConfigWebAutoConfiguration {} diff --git a/src/catalog/cache/src/main/java/org/geoserver/cloud/autoconfigure/catalog/cache/BackendCacheAutoConfiguration.java b/src/catalog/cache/src/main/java/org/geoserver/cloud/autoconfigure/catalog/cache/BackendCacheAutoConfiguration.java index 05b774547..32628c8e9 100644 --- a/src/catalog/cache/src/main/java/org/geoserver/cloud/autoconfigure/catalog/cache/BackendCacheAutoConfiguration.java +++ b/src/catalog/cache/src/main/java/org/geoserver/cloud/autoconfigure/catalog/cache/BackendCacheAutoConfiguration.java @@ -5,9 +5,9 @@ package org.geoserver.cloud.autoconfigure.catalog.cache; import org.geoserver.cloud.catalog.cache.GeoServerBackendCacheConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.cache.CacheManager; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** @@ -19,7 +19,7 @@ * * @see GeoServerBackendCacheConfiguration */ -@Configuration +@AutoConfiguration @ConditionalOnBackendCacheEnabled @Import(GeoServerBackendCacheConfiguration.class) public class BackendCacheAutoConfiguration {} diff --git a/src/catalog/event-bus/src/main/java/org/geoserver/cloud/autoconfigure/event/bus/GeoServerBusIntegrationAutoConfiguration.java b/src/catalog/event-bus/src/main/java/org/geoserver/cloud/autoconfigure/event/bus/GeoServerBusIntegrationAutoConfiguration.java index 2d2281a3c..a3cd4827a 100644 --- a/src/catalog/event-bus/src/main/java/org/geoserver/cloud/autoconfigure/event/bus/GeoServerBusIntegrationAutoConfiguration.java +++ b/src/catalog/event-bus/src/main/java/org/geoserver/cloud/autoconfigure/event/bus/GeoServerBusIntegrationAutoConfiguration.java @@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.cloud.bus.BusAutoConfiguration; import org.springframework.context.annotation.Configuration; @@ -14,7 +15,7 @@ import javax.annotation.PostConstruct; /** Log a message if spring-cloud-bus is explicitly disables */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @Import({ GeoServerBusIntegrationAutoConfiguration.Enabled.class, GeoServerBusIntegrationAutoConfiguration.Disabled.class diff --git a/src/catalog/events/src/main/java/org/geoserver/cloud/autoconfigure/catalog/event/LocalCatalogEventsAutoConfiguration.java b/src/catalog/events/src/main/java/org/geoserver/cloud/autoconfigure/catalog/event/LocalCatalogEventsAutoConfiguration.java index 0d9e7f338..6ee87b042 100644 --- a/src/catalog/events/src/main/java/org/geoserver/cloud/autoconfigure/catalog/event/LocalCatalogEventsAutoConfiguration.java +++ b/src/catalog/events/src/main/java/org/geoserver/cloud/autoconfigure/catalog/event/LocalCatalogEventsAutoConfiguration.java @@ -5,15 +5,15 @@ package org.geoserver.cloud.autoconfigure.catalog.event; import org.geoserver.cloud.config.catalog.events.CatalogApplicationEventsConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** * {@link EnableAutoConfiguration auto-configuration} for {@link * CatalogApplicationEventsConfiguration} */ -@Configuration +@AutoConfiguration @ConditionalOnCatalogEvents @Import(CatalogApplicationEventsConfiguration.class) public class LocalCatalogEventsAutoConfiguration {} diff --git a/src/catalog/events/src/main/java/org/geoserver/cloud/autoconfigure/catalog/event/UpdateSequenceControllerAutoConfiguration.java b/src/catalog/events/src/main/java/org/geoserver/cloud/autoconfigure/catalog/event/UpdateSequenceControllerAutoConfiguration.java index 8c7c428cc..7a2ce317a 100644 --- a/src/catalog/events/src/main/java/org/geoserver/cloud/autoconfigure/catalog/event/UpdateSequenceControllerAutoConfiguration.java +++ b/src/catalog/events/src/main/java/org/geoserver/cloud/autoconfigure/catalog/event/UpdateSequenceControllerAutoConfiguration.java @@ -6,16 +6,16 @@ import org.geoserver.config.GeoServer; import org.geoserver.platform.config.UpdateSequence; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; /** * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnWebApplication @EnableGlobalMethodSecurity(jsr250Enabled = true) public class UpdateSequenceControllerAutoConfiguration { diff --git a/src/catalog/jackson-bindings/starter/src/main/java/org/geoserver/cloud/autoconfigure/jackson/GeoServerJacksonBindingsAutoConfiguration.java b/src/catalog/jackson-bindings/starter/src/main/java/org/geoserver/cloud/autoconfigure/jackson/GeoServerJacksonBindingsAutoConfiguration.java index 4345d2d3f..15762196f 100644 --- a/src/catalog/jackson-bindings/starter/src/main/java/org/geoserver/cloud/autoconfigure/jackson/GeoServerJacksonBindingsAutoConfiguration.java +++ b/src/catalog/jackson-bindings/starter/src/main/java/org/geoserver/cloud/autoconfigure/jackson/GeoServerJacksonBindingsAutoConfiguration.java @@ -8,12 +8,11 @@ import org.geoserver.jackson.databind.catalog.GeoServerCatalogModule; import org.geoserver.jackson.databind.config.GeoServerConfigModule; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * Spring boot {@link EnableAutoConfiguration @EnableAutoConfiguration} to register GeoServer @@ -26,8 +25,7 @@ * despite them being register-able through Jackson's SPI; a configuration like this is needed to * set up the application required ones. */ -@Configuration -@AutoConfigureAfter(GeoToolsJacksonBindingsAutoConfiguration.class) +@AutoConfiguration(after = GeoToolsJacksonBindingsAutoConfiguration.class) @ConditionalOnClass(GeoServerCatalogModule.class) public class GeoServerJacksonBindingsAutoConfiguration { diff --git a/src/catalog/jackson-bindings/starter/src/main/java/org/geoserver/cloud/autoconfigure/jackson/GeoToolsJacksonBindingsAutoConfiguration.java b/src/catalog/jackson-bindings/starter/src/main/java/org/geoserver/cloud/autoconfigure/jackson/GeoToolsJacksonBindingsAutoConfiguration.java index e19598460..35ce2272f 100644 --- a/src/catalog/jackson-bindings/starter/src/main/java/org/geoserver/cloud/autoconfigure/jackson/GeoToolsJacksonBindingsAutoConfiguration.java +++ b/src/catalog/jackson-bindings/starter/src/main/java/org/geoserver/cloud/autoconfigure/jackson/GeoToolsJacksonBindingsAutoConfiguration.java @@ -9,11 +9,11 @@ import org.geotools.jackson.databind.filter.GeoToolsFilterModule; import org.geotools.jackson.databind.geojson.GeoToolsGeoJsonModule; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; /** * Spring boot {@link EnableAutoConfiguration @EnableAutoConfiguration} to register GeoTools and @@ -26,7 +26,7 @@ * despite them being register-able through Jackson's SPI; a configuration like this is needed to * set up the application required ones. */ -@Configuration +@AutoConfiguration @ConditionalOnClass(GeoToolsFilterModule.class) public class GeoToolsJacksonBindingsAutoConfiguration { diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/blobstore/AzureBlobstoreAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/blobstore/AzureBlobstoreAutoConfiguration.java index 87aedf231..492918dd4 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/blobstore/AzureBlobstoreAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/blobstore/AzureBlobstoreAutoConfiguration.java @@ -12,6 +12,7 @@ import org.geoserver.cloud.gwc.config.blobstore.AzureBlobstoreConfiguration; import org.geoserver.cloud.gwc.config.blobstore.AzureBlobstoreGsWebUIConfiguration; import org.geoserver.gwc.web.blob.BlobStorePage; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -22,7 +23,7 @@ * @see ConditionalOnAzureBlobstoreEnabled * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnAzureBlobstoreEnabled @Import({AzureBlobstoreConfiguration.class, GsWebUIAutoConfiguration.class}) @Slf4j(topic = "org.geoserver.cloud.autoconfigure.gwc.blobstore") diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/blobstore/S3BlobstoreAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/blobstore/S3BlobstoreAutoConfiguration.java index df8fe457b..9a20aa305 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/blobstore/S3BlobstoreAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/blobstore/S3BlobstoreAutoConfiguration.java @@ -12,6 +12,7 @@ import org.geoserver.cloud.gwc.config.blobstore.S3BlobstoreConfiguration; import org.geoserver.cloud.gwc.config.blobstore.S3BlobstoreGsWebUIConfiguration; import org.geoserver.gwc.web.blob.BlobStorePage; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -21,7 +22,7 @@ /** * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnS3BlobstoreEnabled @Import({S3BlobstoreConfiguration.class, GsWebUIAutoConfiguration.class}) @Slf4j(topic = "org.geoserver.cloud.autoconfigure.gwc.blobstore") diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/CacheSeedingWebMapServiceAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/CacheSeedingWebMapServiceAutoConfiguration.java index 391790b90..e686037c2 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/CacheSeedingWebMapServiceAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/CacheSeedingWebMapServiceAutoConfiguration.java @@ -13,6 +13,7 @@ import org.geoserver.gwc.layer.GeoServerTileLayer; import org.geoserver.wms.DefaultWebMapService; import org.geoserver.wms.WebMapService; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Configuration; @@ -26,7 +27,7 @@ * * @since 1.0 */ -@Configuration +@AutoConfiguration @ConditionalOnGeoWebCacheEnabled @Import({MinimalWebMapServiceAutoConfiguration.class, WebMapServiceCacheSeedingConfiguration.class}) @Slf4j(topic = "org.geoserver.cloud.autoconfigure.gwc.integration") diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/GeoWebCacheAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/GeoWebCacheAutoConfiguration.java index 6c5ff0749..412ba87a8 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/GeoWebCacheAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/GeoWebCacheAutoConfiguration.java @@ -6,8 +6,7 @@ import org.geoserver.cloud.autoconfigure.gwc.ConditionalOnGeoWebCacheEnabled; import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Import; /** @@ -19,9 +18,8 @@ * @see GeoServerIntegrationAutoConfiguration * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration(after = CacheSeedingWebMapServiceAutoConfiguration.class) @ConditionalOnGeoWebCacheEnabled -@AutoConfigureAfter(CacheSeedingWebMapServiceAutoConfiguration.class) @Import({ // GeoWebCacheCoreAutoConfiguration.class, // GeoServerIntegrationAutoConfiguration.class diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/GeoWebCacheEventsAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/GeoWebCacheEventsAutoConfiguration.java index f44d1250f..5d48265af 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/GeoWebCacheEventsAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/core/GeoWebCacheEventsAutoConfiguration.java @@ -8,7 +8,7 @@ import org.geoserver.cloud.autoconfigure.gwc.ConditionalOnGeoWebCacheEnabled; import org.geoserver.cloud.gwc.config.core.GeoWebCacheLocalEventsConfiguration; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; @@ -18,7 +18,7 @@ * @see ConditionalOnGeoWebCacheEnabled * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnGeoWebCacheEnabled @Import(GeoWebCacheLocalEventsConfiguration.class) @Slf4j(topic = "org.geoserver.cloud.autoconfigure.gwc.core") diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/GeoWebCacheRemoteEventsAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/GeoWebCacheRemoteEventsAutoConfiguration.java index c1edac94a..23b8ecd3f 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/GeoWebCacheRemoteEventsAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/GeoWebCacheRemoteEventsAutoConfiguration.java @@ -9,9 +9,8 @@ import org.geoserver.cloud.autoconfigure.event.bus.ConditionalOnGeoServerRemoteEventsEnabled; import org.geoserver.cloud.autoconfigure.gwc.ConditionalOnGeoWebCacheEnabled; import org.geoserver.cloud.gwc.config.bus.GeoWebCacheRemoteEventsConfiguration; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.cloud.bus.BusAutoConfiguration; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; @@ -22,10 +21,9 @@ * @see ConditionalOnGeoServerRemoteEventsEnabled * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration(after = BusAutoConfiguration.class) @ConditionalOnGeoWebCacheEnabled @ConditionalOnGeoServerRemoteEventsEnabled -@AutoConfigureAfter(BusAutoConfiguration.class) @Import(GeoWebCacheRemoteEventsConfiguration.class) @Slf4j(topic = "org.geoserver.cloud.autoconfigure.gwc.integration") public class GeoWebCacheRemoteEventsAutoConfiguration { diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/WMSIntegrationAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/WMSIntegrationAutoConfiguration.java index bc2b4011d..7bceb7793 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/WMSIntegrationAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/WMSIntegrationAutoConfiguration.java @@ -37,6 +37,7 @@ import org.geowebcache.io.ByteArrayResource; import org.geowebcache.io.Resource; import org.geowebcache.layer.TileLayer; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; @@ -57,7 +58,7 @@ * * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @Import({ WMSIntegrationAutoConfiguration.Enabled.class, WMSIntegrationAutoConfiguration.Disabled.class diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/WMTSIntegrationAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/WMTSIntegrationAutoConfiguration.java index ef1c0da23..9e1d85f43 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/WMTSIntegrationAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/integration/WMTSIntegrationAutoConfiguration.java @@ -9,8 +9,8 @@ import org.geoserver.cloud.autoconfigure.gwc.ConditionalOnWMTSIntegrationEnabled; import org.geoserver.cloud.config.factory.FilteringXmlBeanDefinitionReader; import org.geowebcache.service.wmts.WMTSService; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; import javax.annotation.PostConstruct; @@ -18,7 +18,7 @@ /** * @since 1.0 */ -@Configuration(proxyBeanMethods = true) +@AutoConfiguration @ConditionalOnWMTSIntegrationEnabled @ConditionalOnClass(WMTSService.class) @ImportResource( diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/GoogleMapsAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/GoogleMapsAutoConfiguration.java index 4e980dd74..358d1942d 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/GoogleMapsAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/GoogleMapsAutoConfiguration.java @@ -8,9 +8,9 @@ import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties; import org.geoserver.cloud.gwc.config.services.GoogleMapsConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; @@ -18,7 +18,7 @@ /** * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty( name = GeoWebCacheConfigurationProperties.SERVICE_GMAPS_ENABLED, havingValue = "true", diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/KMLAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/KMLAutoConfiguration.java index cf8fd7255..ff360700a 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/KMLAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/KMLAutoConfiguration.java @@ -8,9 +8,9 @@ import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties; import org.geoserver.cloud.gwc.config.services.KMLConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; @@ -18,7 +18,7 @@ /** * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty( name = GeoWebCacheConfigurationProperties.SERVICE_KML_ENABLED, havingValue = "true", diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/MGMapsAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/MGMapsAutoConfiguration.java index 628677c6b..fbfd982e7 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/MGMapsAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/MGMapsAutoConfiguration.java @@ -8,9 +8,9 @@ import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties; import org.geoserver.cloud.gwc.config.services.MGMapsConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; @@ -18,7 +18,7 @@ /** * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty( name = GeoWebCacheConfigurationProperties.SERVICE_MGMAPS_ENABLED, havingValue = "true", diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/RESTConfigAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/RESTConfigAutoConfiguration.java index 4a9670f46..7e9911f5e 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/RESTConfigAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/RESTConfigAutoConfiguration.java @@ -10,8 +10,8 @@ import org.geoserver.cloud.autoconfigure.gwc.core.DiskQuotaAutoConfiguration; import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties; import org.geoserver.cloud.gwc.config.services.RESTConfigConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; @@ -37,7 +37,7 @@ * * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnGeoWebCacheRestConfigEnabled @ConditionalOnClass(RESTConfigConfiguration.class) @Import(RESTConfigConfiguration.class) diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/TileMapServiceAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/TileMapServiceAutoConfiguration.java index c6c4e8ec3..343bb2103 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/TileMapServiceAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/TileMapServiceAutoConfiguration.java @@ -8,9 +8,9 @@ import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties; import org.geoserver.cloud.gwc.config.services.TileMapServiceConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; @@ -18,7 +18,7 @@ /** * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty( name = GeoWebCacheConfigurationProperties.SERVICE_TMS_ENABLED, havingValue = "true", diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/WebMapServiceAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/WebMapServiceAutoConfiguration.java index ae59c1471..766946464 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/WebMapServiceAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/WebMapServiceAutoConfiguration.java @@ -8,9 +8,9 @@ import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties; import org.geoserver.cloud.gwc.config.services.WebMapServiceConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; @@ -18,7 +18,7 @@ /** * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty( name = GeoWebCacheConfigurationProperties.SERVICE_WMS_ENABLED, havingValue = "true", diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/WebMapTileServiceAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/WebMapTileServiceAutoConfiguration.java index 50d06fca8..221b14a17 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/WebMapTileServiceAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/gwc/service/WebMapTileServiceAutoConfiguration.java @@ -8,9 +8,9 @@ import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties; import org.geoserver.cloud.gwc.config.services.WebMapTileServiceConfiguration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; @@ -18,7 +18,7 @@ /** * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnProperty( name = GeoWebCacheConfigurationProperties.SERVICE_WMTS_ENABLED, havingValue = "true", diff --git a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/web/gwc/GeoWebCacheUIAutoConfiguration.java b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/web/gwc/GeoWebCacheUIAutoConfiguration.java index 14c2d702c..a65a00bf6 100644 --- a/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/web/gwc/GeoWebCacheUIAutoConfiguration.java +++ b/src/gwc/autoconfigure/src/main/java/org/geoserver/cloud/autoconfigure/web/gwc/GeoWebCacheUIAutoConfiguration.java @@ -11,13 +11,13 @@ import org.geoserver.cloud.gwc.config.core.GeoWebCacheConfigurationProperties; import org.geowebcache.rest.controller.ByteStreamController; import org.gwc.web.rest.GeoWebCacheController; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import javax.annotation.PostConstruct; -@Configuration +@AutoConfiguration @ConditionalOnWebUIEnabled @Slf4j(topic = "org.geoserver.cloud.autoconfigure.web.gwc") public class GeoWebCacheUIAutoConfiguration { diff --git a/src/library/spring-boot-simplejndi/src/main/java/org/geoserver/cloud/config/jndidatasource/JNDIDataSourceAutoConfiguration.java b/src/library/spring-boot-simplejndi/src/main/java/org/geoserver/cloud/config/jndidatasource/JNDIDataSourceAutoConfiguration.java index 9d36d8e85..ddc18b1f3 100644 --- a/src/library/spring-boot-simplejndi/src/main/java/org/geoserver/cloud/config/jndidatasource/JNDIDataSourceAutoConfiguration.java +++ b/src/library/spring-boot-simplejndi/src/main/java/org/geoserver/cloud/config/jndidatasource/JNDIDataSourceAutoConfiguration.java @@ -10,9 +10,9 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContextException; -import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.support.DatabaseStartupValidator; import java.util.Map; @@ -25,9 +25,9 @@ /** * @since 1.0 */ -@Slf4j(topic = "org.geoserver.cloud.config.jndidatasource") -@Configuration +@AutoConfiguration @EnableConfigurationProperties(JNDIDataSourcesConfigurationProperties.class) +@Slf4j(topic = "org.geoserver.cloud.config.jndidatasource") public class JNDIDataSourceAutoConfiguration implements InitializingBean { private @Autowired JNDIDataSourcesConfigurationProperties config; diff --git a/src/library/spring-factory/pom.xml b/src/library/spring-factory/pom.xml index 81290d67e..8ceea8785 100644 --- a/src/library/spring-factory/pom.xml +++ b/src/library/spring-factory/pom.xml @@ -11,12 +11,8 @@ Customizable xml bean definition reader - org.springframework - spring-context - - - org.springframework - spring-beans + org.springframework.boot + spring-boot-autoconfigure org.slf4j diff --git a/src/library/spring-factory/src/main/java/org/geoserver/cloud/autoconfigure/factory/FilteringXmlBeanDefinitionReaderAutoConfiguration.java b/src/library/spring-factory/src/main/java/org/geoserver/cloud/autoconfigure/factory/FilteringXmlBeanDefinitionReaderAutoConfiguration.java index 9b8fc597b..6d7f082b3 100644 --- a/src/library/spring-factory/src/main/java/org/geoserver/cloud/autoconfigure/factory/FilteringXmlBeanDefinitionReaderAutoConfiguration.java +++ b/src/library/spring-factory/src/main/java/org/geoserver/cloud/autoconfigure/factory/FilteringXmlBeanDefinitionReaderAutoConfiguration.java @@ -5,7 +5,7 @@ package org.geoserver.cloud.autoconfigure.factory; import org.geoserver.cloud.config.factory.FilteringXmlBeanDefinitionReader; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; @@ -13,7 +13,7 @@ * Calls {@link FilteringXmlBeanDefinitionReader#clearCaches()} once the application context is * refreshed */ -@Configuration +@AutoConfiguration public class FilteringXmlBeanDefinitionReaderAutoConfiguration { @EventListener diff --git a/src/starters/raster-formats/src/main/java/org/geoserver/cloud/autoconfigure/cog/COGAutoConfiguration.java b/src/starters/raster-formats/src/main/java/org/geoserver/cloud/autoconfigure/cog/COGAutoConfiguration.java index ce8205b43..ded66e52a 100644 --- a/src/starters/raster-formats/src/main/java/org/geoserver/cloud/autoconfigure/cog/COGAutoConfiguration.java +++ b/src/starters/raster-formats/src/main/java/org/geoserver/cloud/autoconfigure/cog/COGAutoConfiguration.java @@ -6,12 +6,12 @@ import org.geoserver.cloud.config.factory.FilteringXmlBeanDefinitionReader; import org.geoserver.cog.CogSettings; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; /** Auto configuration to enable the COG (Cloud Optimized GeoTIFF) support as raster data format. */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({CogSettings.class}) @ImportResource( reader = FilteringXmlBeanDefinitionReader.class, // diff --git a/src/starters/raster-formats/src/main/java/org/geoserver/cloud/autoconfigure/pgraster/PostgisRasterWebUIAutoConfiguration.java b/src/starters/raster-formats/src/main/java/org/geoserver/cloud/autoconfigure/pgraster/PostgisRasterWebUIAutoConfiguration.java index 75ec06a5a..4f541776d 100644 --- a/src/starters/raster-formats/src/main/java/org/geoserver/cloud/autoconfigure/pgraster/PostgisRasterWebUIAutoConfiguration.java +++ b/src/starters/raster-formats/src/main/java/org/geoserver/cloud/autoconfigure/pgraster/PostgisRasterWebUIAutoConfiguration.java @@ -7,8 +7,8 @@ import org.geoserver.web.GeoServerApplication; import org.geoserver.web.data.resource.DataStorePanelInfo; import org.geoserver.web.data.store.pgraster.PGRasterCoverageStoreEditPanel; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; /** @@ -18,7 +18,7 @@ * bean in place because of parameterized class incompatibility on {@link * org.geoserver.web.data.resource.DataStorePanelInfo#setComponentClass(Class)} */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @ConditionalOnClass({ GeoServerApplication.class, DataStorePanelInfo.class, diff --git a/src/starters/reactive/src/main/java/org/geoserver/cloud/autoconfigure/core/ReactiveGeoServerMainAutoConfiguration.java b/src/starters/reactive/src/main/java/org/geoserver/cloud/autoconfigure/core/ReactiveGeoServerMainAutoConfiguration.java index af4821fe9..593b9e1fc 100644 --- a/src/starters/reactive/src/main/java/org/geoserver/cloud/autoconfigure/core/ReactiveGeoServerMainAutoConfiguration.java +++ b/src/starters/reactive/src/main/java/org/geoserver/cloud/autoconfigure/core/ReactiveGeoServerMainAutoConfiguration.java @@ -7,9 +7,8 @@ import org.geoserver.cloud.autoconfigure.catalog.backend.core.GeoServerBackendAutoConfiguration; import org.geoserver.cloud.config.catalog.backend.core.GeoServerBackendConfigurer; import org.geoserver.cloud.config.main.GeoServerMainModuleConfiguration; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** @@ -21,7 +20,6 @@ * * @see GeoServerMainModuleConfiguration */ -@Configuration -@AutoConfigureAfter(value = GeoServerBackendAutoConfiguration.class) +@AutoConfiguration(after = GeoServerBackendAutoConfiguration.class) @Import({GeoServerMainModuleConfiguration.class}) public class ReactiveGeoServerMainAutoConfiguration {} diff --git a/src/starters/security/src/main/java/org/geoserver/cloud/autoconfigure/authzn/AuthKeyAutoConfiguration.java b/src/starters/security/src/main/java/org/geoserver/cloud/autoconfigure/authzn/AuthKeyAutoConfiguration.java index 4c3a380e4..1b68876fa 100644 --- a/src/starters/security/src/main/java/org/geoserver/cloud/autoconfigure/authzn/AuthKeyAutoConfiguration.java +++ b/src/starters/security/src/main/java/org/geoserver/cloud/autoconfigure/authzn/AuthKeyAutoConfiguration.java @@ -11,6 +11,7 @@ import org.geoserver.platform.ModuleStatusImpl; import org.geoserver.security.web.auth.AuthenticationFilterPanel; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -22,7 +23,7 @@ /** * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration @Import({AuthKeyAutoConfiguration.Enabled.class, AuthKeyAutoConfiguration.WebUI.class}) @Slf4j(topic = "org.geoserver.cloud.autoconfigure.authzn") public class AuthKeyAutoConfiguration { diff --git a/src/starters/spring-boot/src/main/java/org/geoserver/cloud/app/StartupLoggerAutoConfiguration.java b/src/starters/spring-boot/src/main/java/org/geoserver/cloud/app/StartupLoggerAutoConfiguration.java index 13d0f6cfc..c18b60377 100644 --- a/src/starters/spring-boot/src/main/java/org/geoserver/cloud/app/StartupLoggerAutoConfiguration.java +++ b/src/starters/spring-boot/src/main/java/org/geoserver/cloud/app/StartupLoggerAutoConfiguration.java @@ -4,9 +4,9 @@ */ package org.geoserver.cloud.app; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; /** @@ -17,7 +17,7 @@ * * @since 1.0 */ -@Configuration(proxyBeanMethods = false) +@AutoConfiguration public class StartupLoggerAutoConfiguration { @Bean diff --git a/src/starters/webmvc/src/main/java/org/geoserver/cloud/autoconfigure/core/GeoServerWebMvcMainAutoConfiguration.java b/src/starters/webmvc/src/main/java/org/geoserver/cloud/autoconfigure/core/GeoServerWebMvcMainAutoConfiguration.java index 5a53b74d2..5a3e732d0 100644 --- a/src/starters/webmvc/src/main/java/org/geoserver/cloud/autoconfigure/core/GeoServerWebMvcMainAutoConfiguration.java +++ b/src/starters/webmvc/src/main/java/org/geoserver/cloud/autoconfigure/core/GeoServerWebMvcMainAutoConfiguration.java @@ -6,12 +6,10 @@ import org.geoserver.cloud.autoconfigure.catalog.backend.core.GeoServerBackendAutoConfiguration; import org.geoserver.cloud.config.main.GeoServerMainModuleConfiguration; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Import; /** Autoconfiguration for GeoServer's main module on servlet/webmvc applications */ -@Configuration -@AutoConfigureAfter(GeoServerBackendAutoConfiguration.class) +@AutoConfiguration(after = GeoServerBackendAutoConfiguration.class) @Import({GeoServerMainModuleConfiguration.class}) public class GeoServerWebMvcMainAutoConfiguration {} diff --git a/src/starters/webmvc/src/main/java/org/geoserver/cloud/autoconfigure/servlet/GeoServerServletContextAutoConfiguration.java b/src/starters/webmvc/src/main/java/org/geoserver/cloud/autoconfigure/servlet/GeoServerServletContextAutoConfiguration.java index a725919ce..96a3bb186 100644 --- a/src/starters/webmvc/src/main/java/org/geoserver/cloud/autoconfigure/servlet/GeoServerServletContextAutoConfiguration.java +++ b/src/starters/webmvc/src/main/java/org/geoserver/cloud/autoconfigure/servlet/GeoServerServletContextAutoConfiguration.java @@ -8,15 +8,13 @@ import org.geoserver.cloud.autoconfigure.core.GeoServerWebMvcMainAutoConfiguration; import org.geoserver.cloud.config.servlet.GeoServerServletContextConfiguration; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import javax.annotation.PostConstruct; -@Configuration -@AutoConfigureAfter(GeoServerWebMvcMainAutoConfiguration.class) +@AutoConfiguration(after = GeoServerWebMvcMainAutoConfiguration.class) @ConditionalOnProperty( prefix = "geoserver.servlet", name = "enabled", @@ -26,6 +24,7 @@ @Slf4j public class GeoServerServletContextAutoConfiguration { + @AutoConfiguration @ConditionalOnProperty( prefix = "geoserver.servlet", name = "enabled", diff --git a/src/starters/webmvc/src/main/java/org/geoserver/cloud/config/main/GeoServerMainModuleConfiguration.java b/src/starters/webmvc/src/main/java/org/geoserver/cloud/config/main/GeoServerMainModuleConfiguration.java index 3db5d97d8..90e6fdf3b 100644 --- a/src/starters/webmvc/src/main/java/org/geoserver/cloud/config/main/GeoServerMainModuleConfiguration.java +++ b/src/starters/webmvc/src/main/java/org/geoserver/cloud/config/main/GeoServerMainModuleConfiguration.java @@ -53,7 +53,7 @@ * microservices approach, as it reads from {@literal /logs/geoserver.log} * */ -@Configuration(proxyBeanMethods = true) +@Configuration(proxyBeanMethods = false) @ImportResource( // reader = FilteringXmlBeanDefinitionReader.class, // // exclude beans