It would be helpful to have a consturctor for the SpringApplicationBuilder that allows passing a custom ResourceLoader when a different classloader needs to be used for the SpringApplication. There is a method for setting the ResourceLoader after construction but this means the spring factories instances have already been initialized with the default classloader rather than the classloader from the ResourceLoader.

The issue https://github.com/spring-projects/spring-boot/issues/26126 presents a likely scenario where this might be desired.

Comment From: snicoll

As I've indicated on the other issue, we don't need a PR and an issue for the same thing. Considering that you've submitted a proposal, let's continue the discussion there (#26690)