Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend configuring compileJava's inputs to include processResources' output when generating configuration metadata #20323

Closed
wants to merge 1 commit into from

Conversation

larsgrefer
Copy link
Contributor

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.

Related Issues:

#9758
#9732

`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.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 26, 2020
@wilkinsona wilkinsona added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 18, 2020
@wilkinsona wilkinsona added this to the 2.2.x milestone Mar 18, 2020
@wilkinsona wilkinsona changed the title Fix configuration-processor documentation for Gradle Recommend configuring compileJava's inputs to include processResources' output when generating configuration metadata Mar 18, 2020
@wilkinsona wilkinsona self-assigned this Mar 18, 2020
@wilkinsona wilkinsona modified the milestones: 2.2.x, 2.2.6 Mar 18, 2020
@wilkinsona
Copy link
Member

Thanks very much, @larsgrefer. The proposed change is now in 2.2.x and master.

wilkinsona pushed a commit that referenced this pull request Mar 18, 2020
`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
@larsgrefer larsgrefer deleted the patch-5 branch March 18, 2020 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants