There are a number of things in SpringApplication that are inferred at runtime based on the classpath, the environment or another property.
Some of those checks do not work properly in a native image and can lead to larger image size and build time.
This issue is about researching how we could provide a more streamline setup for that case, in no particular order:
- Set the
ApplicationContexttype to use rather than figuring out which one to use based on the web application type - Set the main application class rather than deducing it from the call stack
- Specify the
ApplicationContextInitializersto use - No notion of "sources" (as the context is ready)
Comment From: snicoll
I am wondering if we want to do this as described or rather optimize thing on a case-by-case basis. Flagging for team attention to see if the team feels differently.
Comment From: philwebb
At this point I think doing things case-by-case is best, possibly even leaving a few things as sub-optimal until 3.1.
Comment From: snicoll
Alright. Let's close this one then, no need to have it around.