@ConfigurationProperties Spring Boot Configuration Annotation Processor not found in classpath

前端 未结 13 1050
太阳男子
太阳男子 2021-02-02 05:06

I try to make completion for custom properties in Spring Boot.

I tried to create a simple project via IntelliJ IDEA 2016.3:

  1. Created a new G
13条回答
  •  走了就别回头了
    2021-02-02 05:46

    For those using Maven or Gradle, just add the dependency on spring-boot-configuration-processor.

    Maven:

    
        org.springframework.boot
        spring-boot-configuration-processor
        true
    
    

    Gradle 4.5 and earlier

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

    Gradle 4.6 and later

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

    For more information: "Generating Your Own Metadata by Using the Annotation Processor" https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/html/appendix-configuration-metadata.html#configuration-metadata-annotation-processor

提交回复
热议问题