问题描述
使用Spring Boot开发的过程中,写读取Properties配置文件的配置类时提示Spring Boot configuration annotation processor not found in classpath,如下截图所示:
官方文档
问题分析
解决方案
在maven中导入自动装配映射的依赖包
在pom.xml文件中加入依赖spring-boot-configuration-processor
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
参考文章
https://blog.csdn.net/qinxian20120/article/details/80252894
https://blog.csdn.net/weixin_38816859/article/details/80301827