Q:

ContextStartedEvent not broadcasted on Spring Boot

I'm migrating application to Spring boot. My application listen on ContextStartedEvent but it looks that Spring boot does not emit such event. I can change my application and listen on ApplicationReadyEvent, but according to spring boot doc, "old" events are still emitted.
I would like to keep my code unchanged as much as possible.
Question: Is ContextStartedEvent supported by Spring Boot or not?
Demo:
@EnableAutoConfiguration
public class EventExample {

    @EventListener(classes = ContextStartedEvent.class)
    void start() { System.out.println("Listen ContextStartedEvent");} //not called

    @EventListener(classes = ApplicationReadyEvent.class) 
    void start2(){System.out.println("Listen ApplicationReadyEvent");} //called

    public static void main(String[] args) throws Exception {
        SpringApplication.run(EventExample.class, args);
    }
}

Output

Listen ApplicationReadyEvent

A:

The ContextStartedEvent is sent when ApplicationContext.start() is called. However SpringApplication.run() doesn't call start(), it only calls refresh(). If you want ContextStartedEvent to be sent then you'll need to start the context. For example:
public static void main(String[] args) throws Exception {
    SpringApplication.run(EventExample.class, args).start();
}

