0

I know that I can load application context from xml file like this:

ApplicationContext app = new ClassPathXmlApplicationContext("META-INF/applicationContext.xml");

But in my case it is irrelevent.

inside the applicationContext.xml I use profiles.

How can I load context according the profile ?

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710

1 Answers1

0

You can set the profile via an JVM property

-Dspring.profiles.active=YOUR_PROFILE_NAMES_AS_COMMA_SEPARATED_LIST

Then Application Context gets created with beans which you have activated using JVM property