Could not resolve placeholder ‘‘“ in value ““

在获取配置文件的配置时报错
@Value("${xxx.xxx}")
public String aaa;

或者使用@ConfigurationProperties(prefix="xx")的到的值是空的

问题出在把配置信息放到了

spring.config.import=optional:file:xxx/x/x.properties

这个配置后面,把配置移到该配置前面即可

你可能感兴趣的:(java,spring,boot)