Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

spring boot configuration annotation processor not found in classpath #4

Closed
JayvinPan opened this issue Jul 18, 2017 · 4 comments
Closed

Comments

@JayvinPan
Copy link

I created a spring boot project with gradle. When I use @ConfigurationProperties, it occured the problem like the title described. Then I add propdeps-plugin at build file, but it doesn't work. Finally, I rewrite the "optional" to "compile", it is working.
image
It is interesting that I use the same way to solve a same problem at a gradle project with spring boot, it doesn't work again.

@bclozel
Copy link
Contributor

bclozel commented Jul 18, 2017

Could you provide a project that reproduces the issue?

@JayvinPan
Copy link
Author

@bclozel
Copy link
Contributor

bclozel commented Jul 19, 2017

I've just tried with a slightly modified version of your build.gradle file:

buildscript {
  ext {
    springBootVersion = '1.5.4.RELEASE'
  }
  repositories {
    mavenCentral()
    maven { url 'http://repo.spring.io/plugins-release' }
  }
  dependencies {
    classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    classpath("io.spring.gradle:propdeps-plugin:0.0.9.RELEASE")
  }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'propdeps'

version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
  mavenCentral()
}

dependencies {
  compile('org.springframework.boot:spring-boot-starter-web')
  testCompile('org.springframework.boot:spring-boot-starter-test')

  optional "org.springframework.boot:spring-boot-configuration-processor"

  //compile('org.springframework.boot:spring-boot-configuration-processor')
}

compileJava.dependsOn(processResources)

And the JSON metadata file is generated at the expected location build/classes/main/META-INF/spring-configuration-metadata.json.

Could you elaborate a bit about this issue?

@JayvinPan
Copy link
Author

It may be some error with my IDE, thanks for your help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants