封装方法
public class Application {
public static void main(String[] args) throws IOException {
FileInputStream inputStream = new FileInputStream(new File(System.getProperty("user.dir")) + "\config\application.properties");
Properties properties = new Properties();
properties.load(inputStream);
inputStream.close();
SpringApplication application = new SpringApplicationBuilder(Application.class).build();
application.setDefaultProperties(properties);
application.run(args);
}
}
本文摘自 :https://www.cnblogs.com/