Spring Boot configuration annotation processor not found in classpath解决办法
使用Spring Boot开发的过程中,使用了Memcache连接池,但在写Memcache相关的Java代码时,IDEA 开发工具提示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,看下到底是什么回事,发现直接给了解决方法,那就是在pom.xml文件中加入依赖spring-boot-configuration-processor,至此问题解决。代码如下:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
问题解决
问题原因:根据提示信息….not found in classpath,查询此注解的使用关于怎么指定classpath,进而查询location,Spring Boot1.5以上版本@ConfigurationProperties取消location注解,在1.5版本后改变了@ConfigurationProperties注解的使用。