Select spring boot xml configuration at runtime

430 Views Asked by At

I have to run a legacy spring boot (2.1.8) app

SpringApplication.run(MyApplication.class, args);

with XML beans config which must be selected at runtime from the src/main/resources dir: a/config.xml or b/config.xml based on an env variable with the respective value a or b. Is there a way to load XML config like this?

1

There are 1 best solutions below

1
On

Have you looked into Spring Profiles; this might get you where you want to be.