@ConfigurationProperties Spring Boot Configuration Annotation Processor not found in classpath

前端 未结 13 1046
太阳男子
太阳男子 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:

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

    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

    0 讨论(0)
提交回复
热议问题