调整属性文件加载顺序,classpath:application.yml 优先于 classpath:config/application.yml(升级注意)

This commit is contained in:
thinkgem
2025-04-17 09:07:44 +08:00
parent 645f6f68fc
commit 6ad05b6037

View File

@@ -36,10 +36,10 @@ public class PropertiesUtils {
// 默认加载的文件可通过继承覆盖若有相同Key优先加载后面的
public static final String[] DEFAULT_CONFIG_FILE = new String[]{
"classpath:application.yml", "classpath:config/application.yml",
"classpath:bootstrap.yml", "classpath:config/bootstrap.yml",
"file:application.yml", "file:config/application.yml",
"file:bootstrap.yml", "file:config/bootstrap.yml",
"classpath:config/application.yml", "classpath:application.yml",
"classpath:config/bootstrap.yml", "classpath:bootstrap.yml",
"file:config/application.yml", "file:application.yml",
"file:config/bootstrap.yml", "file:bootstrap.yml",
};
private static final Logger logger = PropertiesUtils.initLogger();