Any @Component or @Configuration could be marked with @Profile annotation
@Configuration
@Profile("production")
public class ProductionConfiguration {
// ...
}
The same in XML config
<beans profile="dev">
<bean id="dataSource" class="&l...