@ConfigurationProperties Spring Boot Configuration Annotation Processor not found in classpath

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

    following works for me:

    buildscript {
        repositories {
            jcenter()
            maven { url 'https://repo.jenkins-ci.org/public/' }
            maven { url 'http://repo.spring.io/plugins-release' }
        }
        dependencies {
            classpath "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"
        }
    }
    
    ...
    
    apply plugin: 'propdeps'
    apply plugin: 'propdeps-eclipse'
    apply plugin: 'propdeps-idea'
    
    ...
    
    dependencyManagement {
        imports {
            mavenBom 'org.springframework.boot:spring-boot-starter-parent:2.0.0.RELEASE'
        }
    }
    
    ...
    
    dependencies {
        compile "org.springframework.boot:spring-boot-starter"
        compile "org.springframework.boot:spring-boot-starter-actuator"
        annotationProcessor "org.springframework.boot:spring-boot-configuration-processor" // for @ConfigurationProperties, make sure compileJava.dependsOn(processResources)
        ...
    }
    
    compileJava.dependsOn(processResources)
    

提交回复
热议问题