Not registered via @EnableConfigurationProperties, marked as Spring component
当使用@ConfigurationProperties时报这个错误
解决办法:
一、在pom.xml中添加依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
二、在你对应的类中添加@Component注解
这样就没有问题了,如果你没有解决把这个提示改成Warning的话就会在运行时报这个错
Description:
A component required a bean of type ‘com.czxy.changgou4.config.JwtProperties’ that could not be found.
Action:
Consider defining a bean of type ‘com.czxy.changgou4.config.JwtProperties’ in your configuration.