Auto-configure @EnableConfigurationProperties

Add an auto-configuration that avoid a Spring Boot user to add
`@EnableConfigurationProperties` to its configuration to benefit from
that feature.

As our own auto-configurations are tested independently, such annotation
is still present to avoid a useless reference to this new
auto-configuration.

Closes gh-2457
This commit is contained in:
Stephane Nicoll
2015-08-04 13:59:57 +02:00
parent 0e8812f0e9
commit bfe930a873
6 changed files with 144 additions and 5 deletions

View File

@@ -630,9 +630,9 @@ Nested POJO properties can also be created (so a setter is not mandatory) if the
default constructor, or a constructor accepting a single value that can be coerced from
String. Some people use Project Lombok to add getters and setters automatically.
When the `@EnableConfigurationProperties` annotation is applied to your `@Configuration`,
any beans annotated with `@ConfigurationProperties` will be automatically configured from
the `Environment` properties. This style of configuration works particularly well with the
The `@EnableConfigurationProperties` annotation is automatically applied to your project
so that any beans annotated with `@ConfigurationProperties` will be configured from the
`Environment` properties. This style of configuration works particularly well with the
`SpringApplication` external YAML configuration:
[source,yaml,indent=0]