SpringApplicationBuilder Parent-Child hierarchy
<p>I have a parent-child architecture for my Spring Boot application in which there is a separate child for each config file found in a directory.</p>

<p>I am trying to accomplish this using the <code>SpringApplicationBuilder</code> and failing. </p>

<p>At the moment, my <code>main</code> logic looks something like:</p>

<pre><code>SpringApplicationBuilder parentBuilder = new SpringApplicationBuilder(ParentConfiguration.class)
                .properties(Collections.singletonMap("application.dataTypeCount", propertySourceList.size()))
                .logStartupInfo(false);

// for each property source, add it to a child application and start that application
for (PropertySource&lt;?&gt; propertySource : propertySourceList) {
            parentBuilder
                    .child(ChildConfiguration.class)
                    .initializers(context -&gt; context.getEnvironment().getPropertySources().addLast(propertySource))
                    .run(args);
}
</code></pre>

<p>This works pretty well at the moment.</p>

<p>However, I don't have the shutdown behavior I'd like. If <em>any</em> of the children fail to start up, I want every application to stop. What's the best way to achieve this? Seems like there should be something higher level than twiddling around with <code>ApplicationEventListener</code>.</p>