使用注解@ConfigurationProperties时报错

1,使用注解@ConfigurationProperties报错:Spring Boot Configuration Annotation Processor not found in classpath

解决方式:在pom文件添加:

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-configuration-processor</artifactId>
   <optional>true</optional>
</dependency>


2,添加pom之后在添加@ConfigurationProperties注解的类上添加@Component注解

 

猜你喜欢

转载自blog.csdn.net/qq_36662478/article/details/86435025