Add better control over generated files registration #31331
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
theme: aot
An issue related to Ahead-of-time processing
type: enhancement
A general enhancement
Milestone
Affects: 6.0
During test AOT processing, each merged context configuration results in a new initializer being generated. These initializers provide separation for the code that's required to bootstrap the AOT-processed context. When an AOT contribution adds files to the generated context (
generationContext.getGeneratedFiles().addResourceFile(…)
for example), no such separation occurs. As seen in this Spring Boot issue, this can lead to clashes as files from AOT processing of an earlier merged context configuration are overwritten by processing of a subsequent merged context configuration.I think we need a way to separate the files that are generated during AOT processing so that they're isolated on a per-context basis. This would need to work both on the writing side when files are being generated during AOT processing and on the reading side when those generated files are being consumed at runtime when the AOT processed context is refreshed.
The text was updated successfully, but these errors were encountered: