参考:https://www.jianshu.com/p/1bb95eb83ca6

感谢作者分享!

在springboot项目中使用@ConfigurationProperties时,发现注入的字段值全为null,确定配置文件没问题,

@ConfigurationProperties注入的字段为null

后网上搜到解决方法,讲字段添加setter方法即可实现注入

@ConfigurationProperties注入的字段为null

相关文章: