问题描述
在配置类上添加注解:@ConfigurationProperties 后,IDEA中出现以下提示,但是不影响使用:
Spring Boot Configuration Annotation Processor not found in classpath的提示。
点击后面的“Open Documentation…”,弹出提示如下:
Generating Your Own Metadata by Using the Annotation Processor
解决办法
官方给出的解决办法如下,IDEA的提示消失:
①. 使用MAVEN
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
②. 使用GRADLE 4.5 或更早的版本
dependencies {
compileOnly "org.springframework.boot:spring-boot-configuration-processor"
}
③. 使用GRADLE 4.6 或更新的版本
dependencies {
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
}
扩展
- spring-boot-configuration-processor可以完成自定义属性自动补全
- 在SpringBoot中如何自定义starter