File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
spring-boot-project/spring-boot-docs/src/main/asciidoc Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1625,9 +1625,9 @@ property files>>.
1625
1625
[[boot-features-profiles]]
1626
1626
== Profiles
1627
1627
Spring Profiles provide a way to segregate parts of your application configuration and
1628
- make it be available only in certain environments. Any `@Component` or `@Configuration`
1629
- can be marked with `@Profile` to limit when it is loaded, as shown in the following
1630
- example:
1628
+ make it be available only in certain environments. Any `@Component`, `@Configuration`
1629
+ or `@ConfigurationProperties` can be marked with `@Profile` to limit when it is loaded,
1630
+ as shown in the following example:
1631
1631
1632
1632
[source,java,indent=0]
1633
1633
----
@@ -1640,6 +1640,11 @@ example:
1640
1640
}
1641
1641
----
1642
1642
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
+
1643
1648
You can use a `spring.profiles.active` `Environment` property to specify which profiles
1644
1649
are active. You can specify the property in any of the ways described earlier in this
1645
1650
chapter. For example, you could include it in your `application.properties`, as shown in
You can’t perform that action at this time.
0 commit comments