Skip to content

Commit c748f36

Browse files
larsgreferwilkinsona
authored andcommitted
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
1 parent 4b82d7d commit c748f36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ If you are using an `additional-spring-configuration-metadata.json` file, the `c
730730

731731
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
732732
----
733-
compileJava.dependsOn(processResources)
733+
compileJava.inputs.files(processResources)
734734
----
735735

736736
This dependency ensures that the additional metadata is available when the annotation processor runs during compilation.

0 commit comments

Comments
 (0)