From 701c39a3257383941b85795cd572ec9eddff5f69 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 16 Aug 2023 11:26:59 +0200 Subject: [PATCH] Update @PropertySource Javadoc regarding resource patterns See gh-21325 --- .../context/annotation/PropertySource.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java b/spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java index 2f7ae8a5e5ae..75d9fc6b8f6d 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java @@ -184,13 +184,14 @@ *

The default {@link #factory() factory} supports both traditional and * XML-based properties file formats — for example, * {@code "classpath:/com/myco/app.properties"} or {@code "file:/path/to/file.xml"}. - *

Resource location wildcards (e.g. **/*.properties) are not permitted; - * each location must evaluate to exactly one resource. - *

${...} placeholders will be resolved against property sources already + *

As of Spring Framework 6.1, resource location wildcards are also + * supported — for example, {@code "classpath*:/config/*.properties"}. + *

{@code ${...}} placeholders will be resolved against property sources already * registered with the {@code Environment}. See {@linkplain PropertySource above} * for examples. *

Each location will be added to the enclosing {@code Environment} as its own - * property source, and in the order declared. + * property source, and in the order declared (or in the order in which resource + * locations are resolved when location wildcards are used). */ String[] value();