AotProcessor uses hooks to delegate to the application's main class. This lets us reuse whatever customizations has been made there so that the AOT-generated context is consistent with what the application does at runtime.

However, once the AOT process has ran, it should prevent the rest of the main method to run. Consider the following code:

public static void main(String[] args) throws InterruptedException {
    SpringApplication.run(AsyncApplication.class, args);
    Thread.currentThread().join();
}

Once SpringApplication.run completes, this blocks the thread which might be what you need for a particular app, but not when the AOT context runs.