mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Document "annotation processing with Gradle"
Provide details of how to configure Gradle, including the work-around require to parse any additional metadata files. Fixes gh-2316
This commit is contained in:
parent
cdf785a8d1
commit
d5a82aaed8
@ -180,7 +180,24 @@ an optional dependency, for example with Maven you would add:
|
||||
</dependency>
|
||||
----
|
||||
|
||||
The annotation will pickup both classes and methods that are annotated with
|
||||
With Gradle, you can use the https://github.com/spring-projects/gradle-plugins/tree/master/propdeps-plugin[propdeps-plugin]
|
||||
and specify:
|
||||
|
||||
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
dependencies {
|
||||
optional "org.springframework.boot:spring-boot-configuration-processor"
|
||||
}
|
||||
|
||||
compileJava.dependsOn(processResources)
|
||||
}
|
||||
----
|
||||
|
||||
NOTE: You need to add `compileJava.dependsOn(processResources)` to your build to ensure
|
||||
that resources are processed before code is compiled. Without this directive any
|
||||
`additional-spring-configuration-metadata.json` files will not be processed.
|
||||
|
||||
The processor will pickup both classes and methods that are annotated with
|
||||
`@ConfigurationProperties`. The Javadoc for field values within configuration classes
|
||||
will be used to populate the `description` attribute.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user