错误:Not registered via @EnableConfigurationProperties, marked as Spring component, or scanned via @ConfigurationPropertiesScan
原因:当使用@ConfigurationProperties时IDEA顶部出现这样的提示:
解决方式:
方式一:通过依赖和注解解决
1、添加依赖
org.springframework.boot spring-boot-configuration-processor true
2、添加注解@Component,声明将这个组件添加至容器中
解决方式二:直接在SpringBoot启动类上加注解
参考:https://blog.csdn.net/weixin_44495678/article/details/108142287



