【发布时间】:2016-12-15 12:30:37
【问题描述】:
我正在使用 Spring @PropertySource 注释根据环境变量加载属性文件。 (在Windows中设置System variablesof this window)
我设置MY_APP = C:\Cliché
现在我的@Configuration 类也被注释了:
@PropertySource(value = "file:${MY_APP}/config/my.properties"
但 Spring 无法加载该文件,因为它似乎将 URL/路径解析为:C:\Clich,\config\my.properties
为什么?
【问题讨论】:
标签: java spring utf-8 properties