Not registered via @EnableConfigurationProperties or marked as Spring component
来自ling
https://blog.csdn.net/qq_42635345/article/details/85761314
使用@ConfigurationProperties注解,以前用的挺好没出现问题,换了IDEA的版本使用,发现报错了,具体报错如下:
Spring Boot Configuration Annotation Processor not found in classpath
解决方式:
添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
导入依赖之后,发现依然报错:
解决方式:
在配置类上,加上注解@EnableConfigurationProperties(CorsProperties.class)即可!
各位有问题留言,我会尽力为大家解决。