I don't know grails but with Java, I would set the listener container autoStartup
property to false and start()
the container when you are ready. But that won't work if there's an explicit start()
of the context itself before gradle is ready.
AutoStart only controls whether SmartLifecycle
beans start automatically on refresh()
(rather than waiting for a start()
). Most SmartLifecycle
objects have auto start true.