-
Notifications
You must be signed in to change notification settings - Fork 40.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix property ordering within '.' and '/config'
Allow groups to be used with standard locations so that order of profile-specific files is consistent. Prior to this commit, the default search locations considered for application properties/yaml files was the following: optional:classpath:/ optional:classpath:/config/ optional:file:./ optional:file:./config/ optional:file:./config/*/ Each of these locations was independent which could cause confusion if certain combinations were used. For example, if profile-specific files were added to `classpath:/` and `classpath:/config/` then the latter would always override the former regardless of the profile ordering. This commit updates `StandardConfigDataLocationResolver` so that a group of locations can be specified for each item. This allows us to define the following set of search locations which provide more logical ordering for profile-specific files optional:classpath:/;optional:classpath:/config/ optional:file:./;optional:file:./config/;optional:file:./config/*/ Closes gh-26593
- Loading branch information
Showing
12 changed files
with
164 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
.../spring-boot/src/test/resources/config/file-in-root-and-config-with-profile-p1.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config-file-in-root-and-config-with-profile-p1=true | ||
v1=config-file-in-root-and-config-with-profile-p1 | ||
#v2 intentionally missing |
3 changes: 3 additions & 0 deletions
3
.../spring-boot/src/test/resources/config/file-in-root-and-config-with-profile-p2.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config-file-in-root-and-config-with-profile-p2=true | ||
v1=config-file-in-root-and-config-with-profile-p2 | ||
#v2 intentionally missing |
3 changes: 3 additions & 0 deletions
3
...ect/spring-boot/src/test/resources/config/file-in-root-and-config-with-profile.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config-file-in-root-and-config-with-profile=true | ||
v1=config-file-in-root-and-config-with-profile | ||
v2=config-file-in-root-and-config-with-profile |
3 changes: 3 additions & 0 deletions
3
...project/spring-boot/src/test/resources/file-in-root-and-config-with-profile-p1.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
file-in-root-and-config-with-profile-p1=true | ||
v1=file-in-root-and-config-with-profile-p1 | ||
v2=file-in-root-and-config-with-profile-p1 |
3 changes: 3 additions & 0 deletions
3
...project/spring-boot/src/test/resources/file-in-root-and-config-with-profile-p2.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
file-in-root-and-config-with-profile-p2=true | ||
v1=file-in-root-and-config-with-profile-p2 | ||
v2=file-in-root-and-config-with-profile-p2 |
3 changes: 3 additions & 0 deletions
3
...ot-project/spring-boot/src/test/resources/file-in-root-and-config-with-profile.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
file-in-root-and-config-with-profile=true | ||
v1=file-in-root-and-config-with-profile | ||
v2=file-in-root-and-config-with-profile |