I'm trying to create an application using spring boot with an hierarchical application context. My current main method looks like:
public static void main(String[] args) {
new SpringApplicationBuilder(TestApplication.class)
.child(AuditServiceConfiguration.class).web(true)
.child(TaskServiceConfiguration.class).web(true)
.run(args);
}
and the two children configurations are annotated with:
@EnableAutoConfiguration
@Configuration
The idea is to have a parent context containing all common beans and each child context to run its own MVC while being isolated from its siblings.
Unfortunately when I run the above, only the last child context is initialised and started.
Any pointers in the right direction would be greatly appreciated.
Regards,
Alessandro