Spring Profiles provide a way to segregate parts of your application configuration and make it only available in certain environments. Any @Component
or @Configuration
can be marked with @Profile
to limit when it is loaded:
@Configuration
@Profile("production")
public class ProductionConfiguration {
// ...
}
spring.profiles.active
Environment
property to specify which profiles are active. You can specify the property in any of the usual ways, for example you could include it in your application.properties
spring.profiles.active=dev,hsqldb
--spring.profiles.active=dev,hsqldb.
https://docs.spring.io/spring-boot/docs/1.2.0.M1/reference/html/boot-features-profiles.html
Profile specific configuration files