标签:ace data- static hold 代码 data strong AC ati
@Bean public static PropertySourcesPlaceholderConfigurer properties() { PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer(); YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean(); yaml.setResources(new FileSystemResource("/dir/application.yml"));//File引入 //yaml.setResources(new ClassPathResource("application.yml"));//class引入 configurer.setProperties(yaml.getObject()); return configurer; }
SpringBoot读取配置文件(从classpath/file读取yml/properties文件)
标签:ace data- static hold 代码 data strong AC ati
原文地址:https://www.cnblogs.com/gossip/p/9014616.html