Browse Source

Relocate `EnvironmentPostProcessor` and implementations out of `env`

Move the `EnvironmentPostProcessor` from `org.springframework.boot.env`
to `org.springframework.boot` so that we can make the `env` package
foundational.

Most `EnvironmentPostProcessor` implementation has also been relocated
to a new `org.springframework.boot.support` package.

See gh-47232
pull/47268/head
Phillip Webb 3 months ago
parent
commit
6c84674c33
  1. 3
      config/checkstyle/import-control.xml
  2. 9
      core/spring-boot/src/main/java/org/springframework/boot/EnvironmentPostProcessor.java
  3. 2
      core/spring-boot/src/main/java/org/springframework/boot/cloud/CloudFoundryVcapEnvironmentPostProcessor.java
  4. 2
      core/spring-boot/src/main/java/org/springframework/boot/context/config/AnsiOutputApplicationListener.java
  5. 2
      core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessor.java
  6. 2
      core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLoaderContext.java
  7. 2
      core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocationResolverContext.java
  8. 13
      core/spring-boot/src/main/java/org/springframework/boot/env/RandomValuePropertySource.java
  9. 5
      core/spring-boot/src/main/java/org/springframework/boot/support/EnvironmentPostProcessorApplicationListener.java
  10. 5
      core/spring-boot/src/main/java/org/springframework/boot/support/EnvironmentPostProcessorsFactory.java
  11. 6
      core/spring-boot/src/main/java/org/springframework/boot/support/RandomValuePropertySourceEnvironmentPostProcessor.java
  12. 3
      core/spring-boot/src/main/java/org/springframework/boot/support/ReflectionEnvironmentPostProcessorsFactory.java
  13. 5
      core/spring-boot/src/main/java/org/springframework/boot/support/SpringApplicationJsonEnvironmentPostProcessor.java
  14. 3
      core/spring-boot/src/main/java/org/springframework/boot/support/SpringFactoriesEnvironmentPostProcessorsFactory.java
  15. 5
      core/spring-boot/src/main/java/org/springframework/boot/support/SystemEnvironmentPropertySourceEnvironmentPostProcessor.java
  16. 23
      core/spring-boot/src/main/java/org/springframework/boot/support/package-info.java
  17. 10
      core/spring-boot/src/main/resources/META-INF/spring.factories
  18. 4
      core/spring-boot/src/main/resources/META-INF/spring/aot.factories
  19. 2
      core/spring-boot/src/test/java/org/springframework/boot/env/EnvironmentPostProcessorsFactoryTests.java
  20. 5
      core/spring-boot/src/test/java/org/springframework/boot/support/EnvironmentPostProcessorApplicationListenerTests.java
  21. 2
      core/spring-boot/src/test/java/org/springframework/boot/support/RandomValuePropertySourceEnvironmentPostProcessorTests.java
  22. 3
      core/spring-boot/src/test/java/org/springframework/boot/support/ReflectionEnvironmentPostProcessorsFactoryTests.java
  23. 2
      core/spring-boot/src/test/java/org/springframework/boot/support/SpringApplicationJsonEnvironmentPostProcessorTests.java
  24. 4
      core/spring-boot/src/test/java/org/springframework/boot/support/SystemEnvironmentPropertySourceEnvironmentPostProcessorTests.java
  25. 2
      documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.java
  26. 2
      documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.kt
  27. 4
      module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/RemoteSpringApplication.java
  28. 2
      module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsHomePropertiesPostProcessor.java
  29. 2
      module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java
  30. 2
      module/spring-boot-devtools/src/main/resources/META-INF/spring.factories
  31. 2
      module/spring-boot-integration/src/main/java/org/springframework/boot/integration/autoconfigure/IntegrationPropertiesEnvironmentPostProcessor.java
  32. 2
      module/spring-boot-integration/src/main/resources/META-INF/spring.factories
  33. 2
      module/spring-boot-micrometer-tracing/src/main/java/org/springframework/boot/micrometer/tracing/autoconfigure/LogCorrelationEnvironmentPostProcessor.java
  34. 2
      module/spring-boot-micrometer-tracing/src/main/resources/META-INF/spring.factories
  35. 2
      module/spring-boot-reactor/src/main/java/org/springframework/boot/reactor/ReactorEnvironmentPostProcessor.java
  36. 2
      module/spring-boot-reactor/src/main/resources/META-INF/spring.factories
  37. 2
      module/spring-boot-web-server-test/src/main/java/org/springframework/boot/web/server/test/SpringBootTestRandomPortEnvironmentPostProcessor.java
  38. 2
      module/spring-boot-web-server-test/src/main/resources/META-INF/spring.factories
  39. 2
      smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/ActiveProfilesEnvironmentPostProcessor.java
  40. 2
      smoke-test/spring-boot-smoke-test-profile/src/main/resources/META-INF/spring.factories
  41. 2
      smoke-test/spring-boot-smoke-test-profile/src/test/java/smoketest/profile/ActiveProfilesTests.java

3
config/checkstyle/import-control.xml

@ -17,6 +17,9 @@ @@ -17,6 +17,9 @@
<subpackage name="bootstrap">
<disallow pkg="org.springframework.boot" exact-match="true"/>
</subpackage>
<subpackage name="env">
<disallow pkg="org.springframework.boot" exact-match="true"/>
</subpackage>
<subpackage name="ssl">
<disallow pkg="org.springframework.boot" exact-match="true"/>
</subpackage>

9
core/spring-boot/src/main/java/org/springframework/boot/env/EnvironmentPostProcessor.java → core/spring-boot/src/main/java/org/springframework/boot/EnvironmentPostProcessor.java

@ -14,9 +14,8 @@ @@ -14,9 +14,8 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.bootstrap.BootstrapContext;
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
@ -34,8 +33,8 @@ import org.springframework.core.env.Environment; @@ -34,8 +33,8 @@ import org.springframework.core.env.Environment;
* interface or use an {@link org.springframework.core.annotation.Order @Order} annotation
* if they wish to be invoked in specific order.
* <p>
* Since Spring Boot 2.4, {@code EnvironmentPostProcessor} implementations may optionally
* take the following constructor parameters:
* {@code EnvironmentPostProcessor} implementations may optionally take the following
* constructor parameters:
* <ul>
* <li>{@link DeferredLogFactory} - A factory that can be used to create loggers with
* output deferred until the application has been fully prepared (allowing the environment
@ -47,7 +46,7 @@ import org.springframework.core.env.Environment; @@ -47,7 +46,7 @@ import org.springframework.core.env.Environment;
*
* @author Andy Wilkinson
* @author Stephane Nicoll
* @since 1.3.0
* @since 4.0.0
*/
@FunctionalInterface
public interface EnvironmentPostProcessor {

2
core/spring-boot/src/main/java/org/springframework/boot/cloud/CloudFoundryVcapEnvironmentPostProcessor.java

@ -25,9 +25,9 @@ import java.util.Properties; @@ -25,9 +25,9 @@ import java.util.Properties;
import org.apache.commons.logging.Log;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.json.JsonParser;
import org.springframework.boot.json.JsonParserFactory;
import org.springframework.boot.logging.DeferredLogFactory;

2
core/spring-boot/src/main/java/org/springframework/boot/context/config/AnsiOutputApplicationListener.java

@ -20,7 +20,7 @@ import org.springframework.boot.ansi.AnsiOutput; @@ -20,7 +20,7 @@ import org.springframework.boot.ansi.AnsiOutput;
import org.springframework.boot.ansi.AnsiOutput.Enabled;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.env.EnvironmentPostProcessorApplicationListener;
import org.springframework.boot.support.EnvironmentPostProcessorApplicationListener;
import org.springframework.context.ApplicationListener;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;

2
core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessor.java

@ -24,10 +24,10 @@ import java.util.function.Supplier; @@ -24,10 +24,10 @@ import java.util.function.Supplier;
import org.apache.commons.logging.Log;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
import org.springframework.boot.bootstrap.DefaultBootstrapContext;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.logging.DeferredLogFactory;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;

2
core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLoaderContext.java

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
package org.springframework.boot.context.config;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
import org.springframework.boot.env.EnvironmentPostProcessor;
/**
* Context provided to {@link ConfigDataLoader} methods.

2
core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocationResolverContext.java

@ -18,9 +18,9 @@ package org.springframework.boot.context.config; @@ -18,9 +18,9 @@ package org.springframework.boot.context.config;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.env.EnvironmentPostProcessor;
/**
* Context provided to {@link ConfigDataLocationResolver} methods.

13
core/spring-boot/src/main/java/org/springframework/boot/env/RandomValuePropertySource.java vendored

@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFactory; @@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFactory;
import org.jspecify.annotations.Nullable;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertySource;
import org.springframework.core.env.StandardEnvironment;
@ -143,11 +144,21 @@ public class RandomValuePropertySource extends PropertySource<Random> { @@ -143,11 +144,21 @@ public class RandomValuePropertySource extends PropertySource<Random> {
return HexFormat.of().withLowerCase().formatHex(bytes);
}
/**
* Add a {@link RandomValuePropertySource} to the given {@link Environment}.
* @param environment the environment to add the random property source to
*/
public static void addToEnvironment(ConfigurableEnvironment environment) {
addToEnvironment(environment, logger);
}
static void addToEnvironment(ConfigurableEnvironment environment, Log logger) {
/**
* Add a {@link RandomValuePropertySource} to the given {@link Environment}.
* @param environment the environment to add the random property source to
* @param logger logger used for debug and trace information
* @since 4.0.0
*/
public static void addToEnvironment(ConfigurableEnvironment environment, Log logger) {
MutablePropertySources sources = environment.getPropertySources();
PropertySource<?> existing = sources.get(RANDOM_PROPERTY_SOURCE_NAME);
if (existing != null) {

5
core/spring-boot/src/main/java/org/springframework/boot/env/EnvironmentPostProcessorApplicationListener.java → core/spring-boot/src/main/java/org/springframework/boot/support/EnvironmentPostProcessorApplicationListener.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.util.Arrays;
import java.util.List;
@ -33,6 +33,7 @@ import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContrib @@ -33,6 +33,7 @@ import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContrib
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor;
import org.springframework.beans.factory.aot.BeanFactoryInitializationCode;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
@ -57,7 +58,7 @@ import org.springframework.util.ObjectUtils; @@ -57,7 +58,7 @@ import org.springframework.util.ObjectUtils;
*
* @author Phillip Webb
* @author Stephane Nicoll
* @since 2.4.0
* @since 4.0.0
*/
public class EnvironmentPostProcessorApplicationListener implements SmartApplicationListener, Ordered {

5
core/spring-boot/src/main/java/org/springframework/boot/env/EnvironmentPostProcessorsFactory.java → core/spring-boot/src/main/java/org/springframework/boot/support/EnvironmentPostProcessorsFactory.java

@ -14,12 +14,13 @@ @@ -14,12 +14,13 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.util.List;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
import org.springframework.boot.logging.DeferredLogFactory;
import org.springframework.core.io.support.SpringFactoriesLoader;
@ -29,7 +30,7 @@ import org.springframework.core.io.support.SpringFactoriesLoader; @@ -29,7 +30,7 @@ import org.springframework.core.io.support.SpringFactoriesLoader;
* create the {@link EnvironmentPostProcessor} instances.
*
* @author Phillip Webb
* @since 2.4.0
* @since 4.0.0
*/
@FunctionalInterface
public interface EnvironmentPostProcessorsFactory {

6
core/spring-boot/src/main/java/org/springframework/boot/env/RandomValuePropertySourceEnvironmentPostProcessor.java → core/spring-boot/src/main/java/org/springframework/boot/support/RandomValuePropertySourceEnvironmentPostProcessor.java

@ -14,11 +14,13 @@ @@ -14,11 +14,13 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import org.apache.commons.logging.Log;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.RandomValuePropertySource;
import org.springframework.boot.logging.DeferredLogFactory;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;
@ -27,7 +29,7 @@ import org.springframework.core.env.ConfigurableEnvironment; @@ -27,7 +29,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
* {@link EnvironmentPostProcessor} to add the {@link RandomValuePropertySource}.
*
* @author Phillip Webb
* @since 2.4.0
* @since 4.0.0
*/
public class RandomValuePropertySourceEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered {

3
core/spring-boot/src/main/java/org/springframework/boot/env/ReflectionEnvironmentPostProcessorsFactory.java → core/spring-boot/src/main/java/org/springframework/boot/support/ReflectionEnvironmentPostProcessorsFactory.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.util.ArrayList;
import java.util.Arrays;
@ -23,6 +23,7 @@ import java.util.List; @@ -23,6 +23,7 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.bootstrap.BootstrapContext;
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;

5
core/spring-boot/src/main/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessor.java → core/spring-boot/src/main/java/org/springframework/boot/support/SpringApplicationJsonEnvironmentPostProcessor.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.util.Arrays;
import java.util.Collection;
@ -26,6 +26,7 @@ import java.util.Set; @@ -26,6 +26,7 @@ import java.util.Set;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.json.JsonParser;
import org.springframework.boot.json.JsonParserFactory;
@ -54,7 +55,7 @@ import org.springframework.web.context.support.StandardServletEnvironment; @@ -54,7 +55,7 @@ import org.springframework.web.context.support.StandardServletEnvironment;
* @author Phillip Webb
* @author Madhura Bhave
* @author Artsiom Yudovin
* @since 1.3.0
* @since 4.0.0
*/
public class SpringApplicationJsonEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered {

3
core/spring-boot/src/main/java/org/springframework/boot/env/SpringFactoriesEnvironmentPostProcessorsFactory.java → core/spring-boot/src/main/java/org/springframework/boot/support/SpringFactoriesEnvironmentPostProcessorsFactory.java

@ -14,10 +14,11 @@ @@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.util.List;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.bootstrap.BootstrapContext;
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;

5
core/spring-boot/src/main/java/org/springframework/boot/env/SystemEnvironmentPropertySourceEnvironmentPostProcessor.java → core/spring-boot/src/main/java/org/springframework/boot/support/SystemEnvironmentPropertySourceEnvironmentPostProcessor.java

@ -14,12 +14,13 @@ @@ -14,12 +14,13 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.util.Map;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.origin.Origin;
import org.springframework.boot.origin.OriginLookup;
@ -38,7 +39,7 @@ import org.springframework.util.StringUtils; @@ -38,7 +39,7 @@ import org.springframework.util.StringUtils;
* {@link SystemEnvironmentOrigin} for every system environment property.
*
* @author Madhura Bhave
* @since 2.0.0
* @since 4.0.0
*/
public class SystemEnvironmentPropertySourceEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered {

23
core/spring-boot/src/main/java/org/springframework/boot/support/package-info.java

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
/*
* Copyright 2012-present 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 supporting application concerns and the org.springframework.boot package.
*/
@NullMarked
package org.springframework.boot.support;
import org.jspecify.annotations.NullMarked;

10
core/spring-boot/src/main/resources/META-INF/spring.factories

@ -42,15 +42,15 @@ org.springframework.boot.builder.ParentContextCloserApplicationListener,\ @@ -42,15 +42,15 @@ org.springframework.boot.builder.ParentContextCloserApplicationListener,\
org.springframework.boot.context.FileEncodingApplicationListener,\
org.springframework.boot.context.config.AnsiOutputApplicationListener,\
org.springframework.boot.context.logging.LoggingApplicationListener,\
org.springframework.boot.env.EnvironmentPostProcessorApplicationListener
org.springframework.boot.support.EnvironmentPostProcessorApplicationListener
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.EnvironmentPostProcessor=\
org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor,\
org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor,\
org.springframework.boot.env.RandomValuePropertySourceEnvironmentPostProcessor,\
org.springframework.boot.env.SpringApplicationJsonEnvironmentPostProcessor,\
org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor
org.springframework.boot.support.RandomValuePropertySourceEnvironmentPostProcessor,\
org.springframework.boot.support.SpringApplicationJsonEnvironmentPostProcessor,\
org.springframework.boot.support.SystemEnvironmentPropertySourceEnvironmentPostProcessor
# Failure Analyzers
org.springframework.boot.diagnostics.FailureAnalyzer=\

4
core/spring-boot/src/main/resources/META-INF/spring/aot.factories

@ -13,8 +13,8 @@ org.springframework.boot.logging.structured.StructuredLoggingJsonProperties$Stru @@ -13,8 +13,8 @@ org.springframework.boot.logging.structured.StructuredLoggingJsonProperties$Stru
org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=\
org.springframework.boot.context.properties.ConfigurationPropertiesBeanFactoryInitializationAotProcessor,\
org.springframework.boot.env.EnvironmentPostProcessorApplicationListener$EnvironmentBeanFactoryInitializationAotProcessor,\
org.springframework.boot.logging.structured.StructuredLoggingJsonPropertiesBeanFactoryInitializationAotProcessor
org.springframework.boot.logging.structured.StructuredLoggingJsonPropertiesBeanFactoryInitializationAotProcessor,\
org.springframework.boot.support.EnvironmentPostProcessorApplicationListener$EnvironmentBeanFactoryInitializationAotProcessor
org.springframework.beans.factory.aot.BeanRegistrationAotProcessor=\
org.springframework.boot.context.properties.ConfigurationPropertiesBeanRegistrationAotProcessor

2
core/spring-boot/src/test/java/org/springframework/boot/env/EnvironmentPostProcessorsFactoryTests.java vendored

@ -21,9 +21,11 @@ import java.util.function.Supplier; @@ -21,9 +21,11 @@ import java.util.function.Supplier;
import org.junit.jupiter.api.Test;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.bootstrap.DefaultBootstrapContext;
import org.springframework.boot.logging.DeferredLogFactory;
import org.springframework.boot.support.EnvironmentPostProcessorsFactory;
import org.springframework.core.OverridingClassLoader;
import org.springframework.core.env.ConfigurableEnvironment;

5
core/spring-boot/src/test/java/org/springframework/boot/env/EnvironmentPostProcessorApplicationListenerTests.java → core/spring-boot/src/test/java/org/springframework/boot/support/EnvironmentPostProcessorApplicationListenerTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.io.BufferedWriter;
import java.io.IOException;
@ -38,6 +38,7 @@ import org.springframework.aot.AotDetector; @@ -38,6 +38,7 @@ import org.springframework.aot.AotDetector;
import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.bootstrap.BootstrapRegistry;
@ -46,9 +47,9 @@ import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEven @@ -46,9 +47,9 @@ import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEven
import org.springframework.boot.context.event.ApplicationFailedEvent;
import org.springframework.boot.context.event.ApplicationPreparedEvent;
import org.springframework.boot.context.event.ApplicationStartingEvent;
import org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.EnvironmentBeanFactoryInitializationAotProcessor;
import org.springframework.boot.logging.DeferredLogFactory;
import org.springframework.boot.logging.DeferredLogs;
import org.springframework.boot.support.EnvironmentPostProcessorApplicationListener.EnvironmentBeanFactoryInitializationAotProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

2
core/spring-boot/src/test/java/org/springframework/boot/env/RandomValuePropertySourceEnvironmentPostProcessorTests.java → core/spring-boot/src/test/java/org/springframework/boot/support/RandomValuePropertySourceEnvironmentPostProcessorTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.util.function.Supplier;

3
core/spring-boot/src/test/java/org/springframework/boot/env/ReflectionEnvironmentPostProcessorsFactoryTests.java → core/spring-boot/src/test/java/org/springframework/boot/support/ReflectionEnvironmentPostProcessorsFactoryTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.io.InputStream;
import java.util.Arrays;
@ -24,6 +24,7 @@ import java.util.function.Supplier; @@ -24,6 +24,7 @@ import java.util.function.Supplier;
import org.apache.commons.logging.Log;
import org.junit.jupiter.api.Test;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.bootstrap.BootstrapRegistry;
import org.springframework.boot.bootstrap.DefaultBootstrapContext;

2
core/spring-boot/src/test/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessorTests.java → core/spring-boot/src/test/java/org/springframework/boot/support/SpringApplicationJsonEnvironmentPostProcessorTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.util.Collections;
import java.util.Map;

4
core/spring-boot/src/test/java/org/springframework/boot/env/SystemEnvironmentPropertySourceEnvironmentPostProcessorTests.java → core/spring-boot/src/test/java/org/springframework/boot/support/SystemEnvironmentPropertySourceEnvironmentPostProcessorTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.env;
package org.springframework.boot.support;
import java.util.Collections;
import java.util.Map;
@ -22,8 +22,8 @@ import java.util.Map; @@ -22,8 +22,8 @@ import java.util.Map;
import org.junit.jupiter.api.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor.OriginAwareSystemEnvironmentPropertySource;
import org.springframework.boot.origin.SystemEnvironmentOrigin;
import org.springframework.boot.support.SystemEnvironmentPropertySourceEnvironmentPostProcessor.OriginAwareSystemEnvironmentPropertySource;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.PropertySource;
import org.springframework.core.env.StandardEnvironment;

2
documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.java

@ -18,8 +18,8 @@ package org.springframework.boot.docs.howto.application.customizetheenvironmento @@ -18,8 +18,8 @@ package org.springframework.boot.docs.howto.application.customizetheenvironmento
import java.io.IOException;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.env.YamlPropertySourceLoader;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.PropertySource;

2
documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.kt

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
package org.springframework.boot.docs.howto.application.customizetheenvironmentorapplicationcontext
import org.springframework.boot.EnvironmentPostProcessor
import org.springframework.boot.SpringApplication
import org.springframework.boot.env.EnvironmentPostProcessor
import org.springframework.boot.env.YamlPropertySourceLoader
import org.springframework.core.env.ConfigurableEnvironment
import org.springframework.core.env.PropertySource

4
module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/RemoteSpringApplication.java

@ -31,8 +31,8 @@ import org.springframework.boot.devtools.remote.client.RemoteClientConfiguration @@ -31,8 +31,8 @@ import org.springframework.boot.devtools.remote.client.RemoteClientConfiguration
import org.springframework.boot.devtools.restart.RestartInitializer;
import org.springframework.boot.devtools.restart.RestartScopeInitializer;
import org.springframework.boot.devtools.restart.Restarter;
import org.springframework.boot.env.EnvironmentPostProcessorApplicationListener;
import org.springframework.boot.env.EnvironmentPostProcessorsFactory;
import org.springframework.boot.support.EnvironmentPostProcessorApplicationListener;
import org.springframework.boot.support.EnvironmentPostProcessorsFactory;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ApplicationListener;
import org.springframework.core.io.ClassPathResource;

2
module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsHomePropertiesPostProcessor.java vendored

@ -31,9 +31,9 @@ import java.util.function.Supplier; @@ -31,9 +31,9 @@ import java.util.function.Supplier;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.devtools.system.DevToolsEnablementDeducer;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.env.PropertiesPropertySourceLoader;
import org.springframework.boot.env.PropertySourceLoader;
import org.springframework.boot.env.YamlPropertySourceLoader;

2
module/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java vendored

@ -26,11 +26,11 @@ import java.util.Properties; @@ -26,11 +26,11 @@ import java.util.Properties;
import org.apache.commons.logging.Log;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.devtools.logger.DevToolsLogFactory;
import org.springframework.boot.devtools.restart.Restarter;
import org.springframework.boot.devtools.system.DevToolsEnablementDeducer;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.NativeDetector;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

2
module/spring-boot-devtools/src/main/resources/META-INF/spring.factories

@ -8,6 +8,6 @@ org.springframework.boot.devtools.logger.DevToolsLogFactory$Listener,\ @@ -8,6 +8,6 @@ org.springframework.boot.devtools.logger.DevToolsLogFactory$Listener,\
org.springframework.boot.devtools.restart.RestartApplicationListener
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.EnvironmentPostProcessor=\
org.springframework.boot.devtools.env.DevToolsHomePropertiesPostProcessor,\
org.springframework.boot.devtools.env.DevToolsPropertyDefaultsPostProcessor

2
module/spring-boot-integration/src/main/java/org/springframework/boot/integration/autoconfigure/IntegrationPropertiesEnvironmentPostProcessor.java

@ -23,8 +23,8 @@ import java.util.Map; @@ -23,8 +23,8 @@ import java.util.Map;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.env.OriginTrackedMapPropertySource;
import org.springframework.boot.env.PropertiesPropertySourceLoader;
import org.springframework.boot.origin.Origin;

2
module/spring-boot-integration/src/main/resources/META-INF/spring.factories

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.EnvironmentPostProcessor=\
org.springframework.boot.integration.autoconfigure.IntegrationPropertiesEnvironmentPostProcessor

2
module/spring-boot-micrometer-tracing/src/main/java/org/springframework/boot/micrometer/tracing/autoconfigure/LogCorrelationEnvironmentPostProcessor.java

@ -18,8 +18,8 @@ package org.springframework.boot.micrometer.tracing.autoconfigure; @@ -18,8 +18,8 @@ package org.springframework.boot.micrometer.tracing.autoconfigure;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.logging.LoggingSystem;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.EnumerablePropertySource;

2
module/spring-boot-micrometer-tracing/src/main/resources/META-INF/spring.factories

@ -9,7 +9,7 @@ org.springframework.context.ApplicationListener=\ @@ -9,7 +9,7 @@ org.springframework.context.ApplicationListener=\
org.springframework.boot.micrometer.tracing.autoconfigure.OpenTelemetryEventPublisherBeansApplicationListener
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.EnvironmentPostProcessor=\
org.springframework.boot.micrometer.tracing.autoconfigure.LogCorrelationEnvironmentPostProcessor

2
module/spring-boot-reactor/src/main/java/org/springframework/boot/reactor/ReactorEnvironmentPostProcessor.java

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
package org.springframework.boot.reactor;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.thread.Threading;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;

2
module/spring-boot-reactor/src/main/resources/META-INF/spring.factories

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.EnvironmentPostProcessor=\
org.springframework.boot.reactor.ReactorEnvironmentPostProcessor

2
module/spring-boot-web-server-test/src/main/java/org/springframework/boot/web/server/test/SpringBootTestRandomPortEnvironmentPostProcessor.java

@ -20,8 +20,8 @@ import java.util.Objects; @@ -20,8 +20,8 @@ import java.util.Objects;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.convert.ConversionFailedException;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MapPropertySource;

2
module/spring-boot-web-server-test/src/main/resources/META-INF/spring.factories

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.EnvironmentPostProcessor=\
org.springframework.boot.web.server.test.SpringBootTestRandomPortEnvironmentPostProcessor
# Spring Test Context Customizer Factories

2
smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/ActiveProfilesEnvironmentPostProcessor.java

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
package smoketest.profile;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.ConfigurableEnvironment;

2
smoke-test/spring-boot-smoke-test-profile/src/main/resources/META-INF/spring.factories

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.EnvironmentPostProcessor=\
smoketest.profile.ActiveProfilesEnvironmentPostProcessor

2
smoke-test/spring-boot-smoke-test-profile/src/test/java/smoketest/profile/ActiveProfilesTests.java

@ -19,7 +19,7 @@ package smoketest.profile; @@ -19,7 +19,7 @@ package smoketest.profile;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.EnvironmentPostProcessor;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.core.env.Environment;

Loading…
Cancel
Save