我创建了一个名为FileConfig
与以下标注类:如何配置没有locations配置属性的Spring java环境?
file.config.location = fileinfo.yaml
很显然,我的编译器说,该地区酒店:“application.properties”中存在
@ConfigurationProperties(locations = { "classpath:application.properties" , "${file.config.location}" })
下面一行不赞成使用其他位置直接配置环境。有人可以帮助我如何配置环境,使FileConfig
中的变量使用'fileinfo.yaml'文件的内容初始化
使用@PropertySource("classpath:testapplication.properties")
而不是使用上面的代码行会产生错误。
http://stackoverflow.com/questions/36294866/spring-boot-add-new-yml-files-to-application-config –