今天碰到在本地开发环境启动springboot服务正常,但部署到docker容器中却报错:Could not resolve placeholder ‘xxx‘ in value “${XXXX}
在启动类里添加以下代码即可:
@Bean
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
PropertySourcesPlaceholderConfigurer placeholderConfigurer = new PropertySourcesPlaceholderConfigurer(