Skip to content

Commit 3e618fe

Browse files
committed
Merge branch '2.7.x' into 3.0.x
Closes gh-34192
2 parents 864dfe3 + d1fe1ae commit 3e618fe

File tree

3 files changed

+12
-2
lines changed
  • spring-boot-project/spring-boot-docs/src
    • docs/asciidoc/features
    • main
      • java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes
      • kotlin/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes

3 files changed

+12
-2
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ In these cases, specify the list of types to process using the `@EnableConfigura
759759
This can be done on any `@Configuration` class, as shown in the following example:
760760

761761
include::code:MyConfiguration[]
762+
include::code:SomeProperties[]
762763

763764
To use configuration property scanning, add the `@ConfigurationPropertiesScan` annotation to your application.
764765
Typically, it is added to the main application class that is annotated with `@SpringBootApplication` but it can be added to any `@Configuration` class.
@@ -772,7 +773,7 @@ include::code:MyApplication[]
772773
When the `@ConfigurationProperties` bean is registered using configuration property scanning or through `@EnableConfigurationProperties`, the bean has a conventional name: `<prefix>-<fqn>`, where `<prefix>` is the environment key prefix specified in the `@ConfigurationProperties` annotation and `<fqn>` is the fully qualified name of the bean.
773774
If the annotation does not provide any prefix, only the fully qualified name of the bean is used.
774775
775-
The bean name in the example above is `com.example.app-com.example.app.SomeProperties`.
776+
Assuming that it is in the `com.example.app` package, the bean name of the `SomeProperties` example above is `some.properties-com.example.app.SomeProperties`.
776777
====
777778

778779
We recommend that `@ConfigurationProperties` only deal with the environment and, in particular, does not inject other beans from the context.

spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/externalconfig/typesafeconfigurationproperties/enablingannotatedtypes/SomeProperties.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.enablingannotatedtypes;
1818

19-
class SomeProperties {
19+
import org.springframework.boot.context.properties.ConfigurationProperties;
20+
21+
@ConfigurationProperties("some.properties")
22+
public class SomeProperties {
2023

2124
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.springframework.boot.docs.features.externalconfig.typesafeconfigurationproperties.enablingannotatedtypes
2+
3+
import org.springframework.boot.context.properties.ConfigurationProperties
4+
5+
@ConfigurationProperties("some.properties")
6+
class SomeProperties

0 commit comments

Comments
 (0)