Skip to content

Commit d4435e0

Browse files
committed
Polish "Document use of @Profile with @ConfigurationProperties scanning"
Closes gh-16622
1 parent 13b155e commit d4435e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,11 @@ as shown in the following example:
16401640
}
16411641
----
16421642

1643+
NOTE: If `@ConfigurationProperties` beans are registered via `@EnableConfigurationProperties`
1644+
instead of automatic scanning, the `@Profile` annotation needs to be specified on the `@Configuration`
1645+
class that has the `@EnableConfigurationProperties` annotation. In the case where `@ConfigurationProperties`
1646+
are scanned, `@Profile` can be specified on the `@ConfigurationProperties` class itself.
1647+
16431648
You can use a `spring.profiles.active` `Environment` property to specify which profiles
16441649
are active. You can specify the property in any of the ways described earlier in this
16451650
chapter. For example, you could include it in your `application.properties`, as shown in

0 commit comments

Comments
 (0)