@ConfigurationProperties Spring Boot Configuration Annotation Processor not found in classpath

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

    In version 2018.3 of IntelliJ, I solved this problem (as per this documentation) in the following way:

    With Gradle 4.5 and earlier, the dependency should be declared in the compileOnly configuration, as shown in the following example:

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

    With Gradle 4.6 and later, the dependency should be declared in the annotationProcessor configuration, as shown in the following example:

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

提交回复
热议问题