Skip to content

[aot repositories] improve generation of aot metadata #1550

Closed

Description

@martinlippert

At the moment, the mechanism just reads the aot repository metadata file when it is around, but we don't have any support to actually get the metadata file generated. It is automatically generated as a side product of running the build of the project in aot-mode, but we can/should probably provide an easier way to achieve this from within the IDE - and also probably when changing source files of the project, so that those information gets updated quickly.

Activity

  1. added this to the milestone on Apr 23, 2025
  2. added
    for: eclipse
    for: vscode
    and removed on Apr 23, 2025
  3. modified the milestones: , 4.33.0.RELEASE, 5.0.0.RELEASE on Jul 10, 2025
  4. BoykoAlex commented on Nov 11, 2025

    @BoykoAlex
    Contributor

    Work to be tracked here: #1713
    (Started with some cleanup and polishing)

    Next would be a cache of metadata by project. Cache entries invalidated when metadata json file added/removed/changed (maybe project added/removed as well?)

    Idea for further work is use maven/gradle cli command to re-gen aot metadata. Likely the project does not even have to have the plugin in the pom or build.gradle file as plugin could be specified in the cli command. If this is the case perhaps for spring-data 4.x projects the codelens over queries might have some kind of generate/refresh action...

  5. BoykoAlex commented on Nov 13, 2025

    @BoykoAlex
    Contributor

    Unfortunately if I execute the mvn cli command on the Boot LS side there is no event coming from the changed json file. In order to get the event the file needs to be refreshed in the eclipse workspace which implies that it is best to run the maven command on the client via Eclipse m2e launch infra for Eclipse and via the command in VSCode.
    (@martinlippert what do you think about all this? If you see me going off the rails please stop me ;-))

  6. martinlippert commented on Nov 13, 2025

    @martinlippert
    MemberAuthor

    Next would be a cache of metadata by project. Cache entries invalidated when metadata json file added/removed/changed (maybe project added/removed as well?)

    Caching could be done last, I would say.

    Idea for further work is use maven/gradle cli command to re-gen aot metadata. Likely the project does not even have to have the plugin in the pom or build.gradle file as plugin could be specified in the cli command. If this is the case perhaps for spring-data 4.x projects the codelens over queries might have some kind of generate/refresh action...

    Having a "refresh" action code lens aside the code lens that shows the generated query would be nice.
    If there is no metadata file around yet, that code lens could also show up with "show aot-generated query" that then triggers the generation of the metadata file. All of that only if the project has the appropriate version of the Spring Data libs on the classpath, of course... :-)

    Unfortunately if I execute the mvn cli command on the Boot LS side there is no event coming from the changed json file. In order to get the event the file needs to be refreshed in the eclipse workspace which implies that it is best to run the maven command on the client via Eclipse m2e launch infra for Eclipse and via the command in VSCode. (@martinlippert what do you think about all this? If you see me going off the rails please stop me ;-))

    It feels right to me to execute the build actions to generate the metadata file via the client that usually also deals with the build environment, whether it is m2e or buildship, or whatever. So executing the command on the client side makes sense to me. That way, if things go wrong, users would probably have the chance to see the log output of the command as well - which will make debugging this easier if things go wrong on users machines.

  7. BoykoAlex commented on Nov 14, 2025

    @BoykoAlex
    Contributor

    Commands for executing maven goals are in. Needs this for VSCode: microsoft/vscode-maven#1108
    If this all looks good we may even look at Gradle.

  8. modified the milestones: 5.0.0.RC1, 5.0.0.RC2 on Nov 17, 2025
  9. BoykoAlex commented on Nov 25, 2025

    @BoykoAlex
    Contributor

    I have extracted the Gradle case of "Refresh AOT Metadata" into #1722.
    The rest is resolved via:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: eclipsefor: vscodetheme: spring-data-supporttype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions