Skip to content

Commit 1c51398

Browse files
committed
新增 -Dspring.config.additional-location 方式读取配置文件
1 parent 20ff2ce commit 1c51398

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

common/src/main/java/com/jeesite/common/io/PropertiesUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ public static void releadInstance(){
6464
// 获取全局设置默认的配置文件(以下是支持环境配置的属性文件)
6565
Set<String> set = SetUtils.newLinkedHashSet();
6666
set.addAll(Arrays.asList(DEFAULT_CONFIG_FILE));
67-
// 获取 spring.config.location 外部自定义的配置文件
67+
// 获取 spring.config.location、spring.config.additional-location 外部自定义的配置文件
6868
String customConfigs = System.getProperty("spring.config.location");
69+
if (StringUtils.isBlank(customConfigs)){
70+
customConfigs = System.getProperty("spring.config.additional-location");
71+
}
6972
if (StringUtils.isNotBlank(customConfigs)){
7073
for (String customConfig : StringUtils.splitComma(customConfigs)){
7174
if (!customConfig.contains("$")){

0 commit comments

Comments
 (0)