Spring Boot——[Spring Boot Configuration Annotation Processor not found in classpath]解决方案

问题描述

使用Spring Boot开发的过程中,写读取Properties配置文件的配置类时提示Spring Boot configuration annotation processor not found in classpath,如下截图所示:  

官方文档

https://docs.spring.io/spring-boot/docs/2.0.1.RELEASE/reference/html/configuration-metadata.html#configuration-metadata-annotation-processor 

问题分析

解决方案

在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

发布了1385 篇原创文章 · 获赞 245 · 访问量 34万+

猜你喜欢

转载自blog.csdn.net/weixin_43272781/article/details/104261394