Spring Boot recently introduced AotApplicationContextInitializer
to aid with AOT testing support. This class replaces the need to call org.springframework.context.aot.ApplicationContextAotInitializer
from Spring Boot.
If we're the only consumer, then the Framework class could potentially be dropped.
Comment From: snicoll
Thanks for the suggestion. This class is meant to be used by consumers of AOT, Spring Boot being one of them but we anticipate any custom framework built on top of Spring Framework to find it useful as well. I can see that the use in Spring Boot has been replaced by AotApplicationContextInitializer
in Spring Boot.
Shouldn't this be the other way around, with AotApplicationContextInitializer
being contributed here, rather than being a Spring Boot-specific class? Looking at the code it's not obvious to me why that is.
Comment From: philwebb
That's an alternative. I wanted to get the test support into Spring Boot without derailing the Spring Framework release. We need a way for the test code to plug in an ApplicationContextInitializer
that acts as a signal that the convention based one should not be used. If we're happy for the one here to be a real ApplicationContextInitializer
then we could rework things after the next Boot milestone.
Comment From: snicoll
We need a way for the test code to plug in an ApplicationContextInitializer that acts as a signal that the convention based one should not be used. I
I don't think I've understood that but I believe that general entry points should be provided by framework so that custom framework should build upon them the same way Spring Boot does. I've also created #29181 to move/refactor the current AotProcessor
.
Comment From: philwebb
I've pushed a new AotApplicationContextInitializer
interface and deprecated the existing one. I've also refactored Spring Boot to use it. If you're happy with the new one we can probably delete ApplicationContextAotInitializer
before RC1
Comment From: snicoll
Cool. I like it.