public static void initProperty(String environment) throws IOException {
InputStream inStream = null;
if("local".equals(environment)) {
inStream = new FileInputStream(new File("src/main/resources/application-local.property"));
}
if("test".equals(environment)) {
inStream = new FileInputStream(new File("src/main/resources/application-test.property"));
}
if("prod".equals(environment)) {
inStream = new FileInputStream(new File("src/main/resources/application-prod.property"));
}
properties.load(inStream);
}
Java-指定参数启动配置文件
最新推荐文章于 2023-11-21 14:39:25 发布