Skip to content

Commit f76d67d

Browse files
committed
Merge branch 'main' into 4.0.x
2 parents 38885a8 + 3145ddf commit f76d67d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/external-config.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,9 +1167,15 @@ NOTE: The preceding merging rules apply to properties from all property sources,
11671167
Spring Boot attempts to coerce the external application properties to the right type when it binds to the javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] beans.
11681168
If you need custom type conversion, you can provide a javadoc:org.springframework.core.convert.ConversionService[] bean (with a bean named `conversionService`) or custom property editors (through a javadoc:org.springframework.beans.factory.config.CustomEditorConfigurer[] bean) or custom converters (with bean definitions annotated as javadoc:org.springframework.boot.context.properties.ConfigurationPropertiesBinding[format=annotation]).
11691169

1170-
NOTE: As this bean is requested very early during the application lifecycle, make sure to limit the dependencies that your javadoc:org.springframework.core.convert.ConversionService[] is using.
1170+
[NOTE]
1171+
====
1172+
Beans used for property conversion are requested very early during the application lifecycle so make sure to limit the dependencies that your javadoc:org.springframework.core.convert.ConversionService[] is using.
11711173
Typically, any dependency that you require may not be fully initialized at creation time.
1172-
You may want to rename your custom javadoc:org.springframework.core.convert.ConversionService[] if it is not required for configuration keys coercion and only rely on custom converters qualified with javadoc:org.springframework.boot.context.properties.ConfigurationPropertiesBinding[format=annotation].
1174+
1175+
You should also declare any javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] beans using `static` methods to avoid "`bean is not eligible for getting processed by all BeanPostProcessors`" warnings.
1176+
====
1177+
1178+
TIP: You may want to rename your custom javadoc:org.springframework.core.convert.ConversionService[] if it is not required for configuration keys coercion and only rely on custom converters qualified with javadoc:org.springframework.boot.context.properties.ConfigurationPropertiesBinding[format=annotation].
11731179

11741180

11751181

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
* <p>
3838
* Note that contrary to {@code @Value}, SpEL expressions are not evaluated since property
3939
* values are externalized.
40+
* <p>
41+
* Static methods should be used when declaring {@code @ConfigurationProperties} beans to
42+
* ensure that "bean is not eligible for getting processed by all BeanPostProcessors"
43+
* warnings are not produced.
4044
*
4145
* @author Dave Syer
4246
* @since 1.0.0

0 commit comments

Comments
 (0)