在springboot启动之前读取配置文件(jar包外也可)



1
  private static Properties getProperties() throws IOException {
2      ClassPathResource resource = new ClassPathResource("application.yml");
3      return PropertiesLoaderUtils.loadProperties(resource);
4  }