Spring Boot将自动解析application.properties文件中的任何${ENV}占位符,以及相应的环境变量.
但是,当我通过Quartz配置的Propertiesfactorybean文件提供quartz.properties时,不会发生这种解决方案.
@Bean
public Properties getQuartzProperties() throws IOException {
Propertiesfactorybean propertiesfactorybean = new Propertiesfactorybean();
propertiesfactorybean.setLocation(new ClassPathResource("/quartz.properties"));
propertiesfactorybean.afterPropertiesSet();
return propertiesfactorybean.getObject();
}
最佳答案