先读取配置文件
通过 InputStream 读取文件
SpringApplication app = new SpringApplication(DDXMApplication.class);
InputStream inputStream = DDXMApplication.class.getClassLoader().getResourceAsStream("application-dev.properties");
Properties properties = new Properties();
try {
properties.load(inputStream);
}catch (Exception ex){
if(inputStream!=null){
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
properties.put("jasypt.encryptor.password","salt");
app.setDefaultProperties(properties);
app.run(args);