欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

【SpringBoot】Spring Boot Configuration Annotation Processor not found in classpath

程序员文章站 2024-03-14 21:52:05
...

问题描述:使用@ConfigurationProperties在idea中报如下错误:

【SpringBoot】Spring Boot Configuration Annotation Processor not found in classpath

解决方式:

maven方式:

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

grade方式:

dependencies {
    optional "org.springframework.boot:spring-boot-configuration-processor"
}

compileJava.dependsOn(processResources)

参考官方链接:https://docs.spring.io/spring-boot/docs/1.5.3.RELEASE/reference/html/configuration-metadata.html#configuration-metadata-annotation-processor

 

效果:

【SpringBoot】Spring Boot Configuration Annotation Processor not found in classpath