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

Allow arbitrary packages to be scanned for Reflective usage #33132

Closed
snicoll opened this issue Jul 1, 2024 · 1 comment
Closed

Allow arbitrary packages to be scanned for Reflective usage #33132

snicoll opened this issue Jul 1, 2024 · 1 comment
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Jul 1, 2024

Follow-up of #29194

We'd like to make sure that non beans can define @Reflective usage (or any composed annotations using it), so that any type can provide that information. It's a bit unclear how we can integrate such scanning. I don't know if we should go as far as introducing a @ReflectiveScan that behaves the same way as @ComponentScan but for reflective usage.

I already have a working implementation that needs to be called explicitly with the packages to scan, see snicoll@24dc359.

Whether or not we want to introduce @ReflectiveScan is largely dependent on how Spring Boot would like to integrate this feature. Ping @wilkinsona for feedback.

@snicoll snicoll added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Jul 1, 2024
@snicoll snicoll added this to the 6.2.x milestone Jul 1, 2024
@snicoll snicoll self-assigned this Jul 1, 2024
@snicoll
Copy link
Member Author

snicoll commented Jul 4, 2024

As part of fixing this, we should make sure to review the javadoc of the existing annotation as well as the reference guide to provide examples to users.

snicoll added a commit to snicoll/spring-framework that referenced this issue Jul 6, 2024
This commit allows `@Reflective` to be used on arbitrary types, not
only Spring beans. This makes the feature much more powerful as
components can be tagged directly.

Scanning happens during AOT processing (typically at build-time) when
`@ReflectiveScan` is used. Types do not need to have a particular
annotation, and types that can't be loaded are ignored.

This commit also exposes the infrastructure that does the scanning so
that custom code can do the scanning in an AOT contribution if they
don't want to rely on the annotation.

Closes spring-projectsgh-33132
@snicoll snicoll modified the milestones: 6.2.x, 6.2.0-M5 Jul 8, 2024
@snicoll snicoll closed this as completed in 93587da Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant