@Bean
public Properties appConstantsProperties() throws IOException {
PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
propertiesFactoryBean.setLocation(new ClassPathResource("/app-constants.properties"));
propertiesFactoryBean.afterPropertiesSet();
return propertiesFactoryBean.getObject();
}
相关文章:
- SpringBoot 配置文件与依赖库分离打包配置 2019-11-23
- webpack(11)配置文件分离为开发配置、生成配置和基础配置 2021-07-13
- springboot配置 2021-02-02
- [ASP.NET Core 3框架揭秘] 配置[4]:将配置绑定为对象 2019-12-12
- SpringBoot基础学习(二) SpringBoot全局配置文件及配置文件属性值注入 2021-06-02
- Springboot 系列(二)Spring Boot 配置文件 2021-12-03
- SpringBoot加载配置文件(@PropertySource@importSource@Value) 2019-06-21
- JAVAEE——SpringBoot配置:配置文件、YAML语法、文件值注入、加载位置与顺序、自动配置原理 2018-09-17