Skip to content

Commit d5a82aa

Browse files
committed
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
1 parent cdf785a commit d5a82aa

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,24 @@ an optional dependency, for example with Maven you would add:
180180
</dependency>
181181
----
182182

183-
The annotation will pickup both classes and methods that are annotated with
183+
With Gradle, you can use the https://github.com/spring-projects/gradle-plugins/tree/master/propdeps-plugin[propdeps-plugin]
184+
and specify:
185+
186+
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
187+
----
188+
dependencies {
189+
optional "org.springframework.boot:spring-boot-configuration-processor"
190+
}
191+
192+
compileJava.dependsOn(processResources)
193+
}
194+
----
195+
196+
NOTE: You need to add `compileJava.dependsOn(processResources)` to your build to ensure
197+
that resources are processed before code is compiled. Without this directive any
198+
`additional-spring-configuration-metadata.json` files will not be processed.
199+
200+
The processor will pickup both classes and methods that are annotated with
184201
`@ConfigurationProperties`. The Javadoc for field values within configuration classes
185202
will be used to populate the `description` attribute.
186203

0 commit comments

Comments
 (0)