From c748f36856e0bf17bea8251e3298598746c50735 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Wed, 26 Feb 2020 17:16:28 +0100 Subject: [PATCH] Fix recommended task dependency configuration `compileJava.dependsOn(processResources)` is not enough to ensure the correct behavior. Using `dependsOn` only affects the execution order (`processResources` before `compileJava`) but not the up-to-date check of `compileJava`. After modifying `META-INF/additional-spring-configuration-metadata.json`, the `processResouces` task will considered out-of-date and will be re-executed, but after that `compileJava` will still be considered up-to-date which causes the changes not to be merged into `META-INF/spring-configuration-metadata.json` With this change the up-do-date check of `compileJava` is affected, too. Therefore, it will correctly re-execute the configuration-processor when `META-INF/additional-spring-configuration-metadata.json` was changed. See gh-20323 --- .../src/main/asciidoc/appendix-configuration-metadata.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc index 1b5767817ae..ab4d6a782c7 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc @@ -730,7 +730,7 @@ If you are using an `additional-spring-configuration-metadata.json` file, the `c [source,groovy,indent=0,subs="verbatim,quotes,attributes"] ---- - compileJava.dependsOn(processResources) + compileJava.inputs.files(processResources) ---- This dependency ensures that the additional metadata is available when the annotation processor runs during compilation.