spring-boot
spring-boot copied to clipboard
Improve SpringApplication to provide a streamline setup for Native image
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
ApplicationContext
type 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
ApplicationContextInitializers
to use - No notion of "sources" (as the context is ready)
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.
At this point I think doing things case-by-case is best, possibly even leaving a few things as sub-optimal until 3.1.
Alright. Let's close this one then, no need to have it around.