我想在PropertySource值选项中使用一个动态占位符。
这是为了能够为每个环境拥有一个文件,该文件覆盖默认的环境。就像application.properties和application-dev.properties一样。
当前设置:
@PropertySource("classpath:ione.properties")我想要一些类似的
@PropertySource("classpath:ione-{optionalEnvName}.properties")因此,读取--spring.profiles.active=dev选项。
谢谢!
发布于 2018-10-08 13:28:04
与:
-Dspring.profiles.active=dev然后:
@PropertySource("classpath:ione-${spring.profiles.active}.properties")应起作用
https://stackoverflow.com/questions/52703139
复制相似问题