Spring 3.1+ : Environments & Profiles

Interesting article over at : http://diarmuidmoloney.wordpress.com/2012/04/07/spring-environments/

Summary: Keep using PPC (PropertyPlaceholderConfigurator) + ${ } for environment specific variables, but now we can use Profiles for environment specific classes.

  • <beans profile=”dev”>

3 Methods for triggering Profiles

  1. System.setProperty(“spring.profiles.active”, “dev”)
  2. -Dspring.profiles.active=”dev”
  3. e = ctx.getEnvironment; e.setActiveProfiles(“dev”); ctx.refresh
Advertisements
Posted in Spring

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: