在使用@ConfigurationProperties时,提示 Configuration Annotation Proessor not found in classpath。
经查,原因是IDEA找不到classpath,可通过location指定,但spring boot 1.5以上的版本@ConfigurationProperties取消了location注解。
解决方法是在pom.xml中添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional> <!-- 可选是否传递依赖 -->
</dependency>
参考链接:点击打开链接
本文介绍了解决在使用@ConfigurationProperties时出现ConfigurationAnnotationProcessor未找到的方法。对于Spring Boot 1.5以上版本,可通过在pom.xml文件中添加特定依赖来解决此问题。
5万+

被折叠的 条评论
为什么被折叠?



