Friday, August 14, 2020

Spring-Profiles

 Spring allows to create different profiles for an application - like Dev, Test, Prod

It is a way to segregate different application configurations and make it available only in certain environment.

Any @Component or @Configuration can be marked with @Profile to limit when it is loaded:

@Configuration
@Profile("production")
public class ProductionConfiguration {

    // ...

}

we can use spring.profiles.active to specify which profiles are active.

No comments:

Post a Comment

Spring - AutoWiring

Spring automatically resolves the dependencies between the collaborating beans by inspecting the contents of the BeanFactory. This is called...