在配置类使用@Value 加载配置的地址
@Value("${ww.mapper-locations}")
private String mailHost;
运行application之后,报错
Could not resolve placeholder ‘xxx‘ in value “${xxx}“
发现配置文件,application.yaml 的定义是这样的
tt:
mapper-locations: classpath:/mapper/*.xml
@Value("${ww.mapper-locations}")的名称有误,应该改成tt.mapper-locations
修改完成,顺利运行