File tree 1 file changed +6
-5
lines changed
spring-boot-project/spring-boot-docs/src/main/asciidoc
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1009,13 +1009,14 @@ name of the bean is used.
1009
1009
The bean name in the example above is `acme-com.example.AcmeProperties`.
1010
1010
====
1011
1011
1012
- Even if the preceding configuration creates a regular bean for `AcmeProperties`, we
1013
- recommend that `@ConfigurationProperties` only deal with the environment and, in
1014
- particular, does not inject other beans from the context. Having said that, the
1012
+ The preceding configuration creates a regular bean for `AcmeProperties`. We recommend that
1013
+ `@ConfigurationProperties` only deal with the environment and, in particular, does not
1014
+ inject other beans from the context. Keep in mind that the
1015
1015
`@EnableConfigurationProperties` annotation is _also_ automatically applied to your
1016
1016
project so that any _existing_ bean annotated with `@ConfigurationProperties` is
1017
- configured from the `Environment`. You could shortcut `MyConfiguration` by making sure
1018
- `AcmeProperties` is already a bean, as shown in the following example:
1017
+ configured from the `Environment`. Instead of annotating `MyConfiguration` with
1018
+ `@EnableConfigurationProperties(AcmeProperties.class)`, you could make `AcmeProperties`
1019
+ a bean, as shown in the following example:
1019
1020
1020
1021
[source,java,indent=0]
1021
1022
----
You can’t perform that action at this time.
0 commit comments