Team,

While I do appreciate the annotation support that has been provided by spring native, it would be so much easier to denote at the class/package level as to whether or not it requires reflection at compile time. The beauty of annotated meta data is that you can reference it inline at the class level instead of having to cross reference between a configuration centric class and the associated POJO that requires reflection.

I see that quarkus has this feature and for good reason, please add to the Spring Framework. https://javadoc.io/doc/io.quarkus/quarkus-core/latest/io/quarkus/runtime/annotations/RegisterForReflection.html

Comment From: bclozel

Hello @srunnoe !

We already have infrastructure for registering hints in RuntimeHints using RuntimeHintsRegistrar (registered in aot.factories files or using @ImportRuntimeHints). Lots of cases are handled automatically as well: the entire configuration model, web controllers, etc.

Could you share a specific example (ideally, with code snippets) showing what you're trying to achieve?

So far we didn't need this approach in Spring Framework and we didn't like the way things were going with spring-native @TypeHints. Testing support and the ability to make those contributions optional were good drivers for this decision.

We can of course reconsider that, so feedback welcome!

Comment From: srunnoe

That might be exactly what I am looking for. Are there any test cases or docs that explain how RuntimeHints work?

I thought the spring-native project was basically getting merged into SpringBoot 3, but it sounds like that isn't the case. Is there any readout anywhere that explains the relationship between the projects?

Comment From: snicoll

I thought the spring-native project was basically getting merged into SpringBoot 3

I don't know what you mean by "merging" but it is certainly not a copy/paste as we've been experimenting a lot and the past months have been focused on using the experience to build native support in the core. From that perspective it can't be a copy/paste to begin with. Spring Native is in minimal maintenance mode for experimenting with Spring Boot 2.x only.

We're still in quite an early stage for this. Our plan is to start documenting things for the next milestone in September. If you want to give things a try, you're very much welcome and I'd recommend looking at the smoke tests.

I am going to close this now, but feel free to comment further if necessary.