- 移除所有 ${VAR:default} 格式的环境变量占位符
- 将默认值直接写入配置文件中
- 删除对 .codex-tmp 秘密文件的依赖
- 修改测试代码使用新的配置加载方式
- 更新 Docker 部署不再使用 env_file
- 应用启动参数直接在 Dockerfile 中定义
- 添加配置自检测试确保无外部依赖
18 lines
641 B
Java
18 lines
641 B
Java
package com.ruoyi.projectdev;
|
|
|
|
import java.util.Properties;
|
|
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
/** Loads the same committed settings as the application; never logs credentials. */
|
|
public final class ProfileConfiguration {
|
|
private ProfileConfiguration() { }
|
|
|
|
public static Properties load(String profile) {
|
|
var yaml = new YamlPropertiesFactoryBean();
|
|
yaml.setResources(new ClassPathResource("application.yml"),
|
|
new ClassPathResource("application-" + profile + ".yml"));
|
|
return yaml.getObject();
|
|
}
|
|
}
|