Skip to content

Add support for generating resources linked to a feature #35862

Closed

Description

@snicoll

There is an inconsistent support in GeneratedContext at the moment. Source code benefits from GeneratedClasses with several helper to generate unique class names based on feature or feature component.

Resources, on the other hand, have no such link. At the moment we need to go through the GeneratedFiles contract which only offers bare bone utilities to add a file whose name is provided by the caller.

Two use cases that this would help with:

  1. If a resource needs to be generated based on Class (like a metadata file, Spring Data does this) then GeneratedResources could take care of the naming (+ location) based on the type and the name of the feature.
  2. Resources are more likely to be idempotent. If a resource is generated based on the type, the type will not change based on the state of the ApplicationContext. This is again the case for Spring Data and we should offer a way to gently ignore if the file has always been generated.

See also #35855 for an example of a file with a unique name that will cause such problem.

Activity

  1. added this to the 7.1.x milestone on Nov 20, 2025
  2. self-assigned this
    on Dec 9, 2025
  3. added a commit that references this issue on Dec 9, 2025
    b194a2d
  4. snicoll commented on Dec 9, 2025

    @snicoll
    MemberAuthor

    This feature is now ready for 7.1.x, see snicoll@b194a2d for more details.

  5. added
    in: coreIssues in core modules (aop, beans, core, context, expression)
    theme: aotAn issue related to Ahead-of-time processing
    on Dec 23, 2025
  6. removed their assignment
    on Apr 17, 2026
  7. modified the milestones: 7.1.x, 7.1.0-M2 on Sep 17, 2026
  8. added a commit that references this issue on Sep 17, 2026
    496ed72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)theme: aotAn issue related to Ahead-of-time processingtype: enhancementA general enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions