Polish "Document use of @Profile with @ConfigurationProperties scanning"

Closes gh-16622
This commit is contained in:
Madhura Bhave 2019-04-30 16:07:33 -07:00
parent 13b155eb2a
commit d4435e015c
1 changed files with 5 additions and 0 deletions

View File

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