I'm currently working on migrating an existing application to Spring Boot 1.2 (uses Mule 3; isn't compatible with Spring 4.2). This application contains a library-provided (that I can't modify) servlet that does the Mule bootstrap process by creating several ClasspathXmlApplicationContexts by reading some app-contained XML files with bean definitions.
My problem is that this XML files contain several placeholders that should be resolved differently based on the active profile (and I've stored those variables on an application.yml file, with different profiles), but the applicationConfig PropertySource isn't available on the StandardEnvironments created by the new application contexts.
I could transform the YML file to a .properties file and create a new PropertyPlaceholderConfigurer inside each of this XML files, pointing to the same application-#{systemProperties['spring.profiles.active']}.properties, but:
I'd lose Boot's flexibility of locating the .properties file in different internal/external locations using convention and precedence, which sounds handy for an application that's gonna by migrating on different environments.
If I need to add the same definition several times, I guess there's a programmatic way of doing it that I'm ignoring.
Does anybody know how could I add the applicationConfig PropertySource's content to all newly-created ApplicationContexts without having access to modify the class that creates them? Spring Boot 1.2 doesn't have the awesomeness of the EnvironmentPostProcessor to do so.