问题描述
在Spring Boot中的application.yml文件中,如果自定义属性会如下提示:
Cannot resolve configuration property ‘*****’
解决方案:
提示:这里填写该问题的具体解决方案:
这里提示Defind Configuration key sourceName
,然后按Alt+Shift+Enter
后,就会创建一个addtional-spring-configuration-metadata.json
的文件
这里name是指定属性名字,type是类型,可以加上defaultValue指定默认值
返回application.yml
查看,问题仍存在。
将addtional-spring-configuration-metadata.json
重命名为spring-configuration-metadata.json
大功告成,问题解决。