Follow the following methods to set an active profile in Spring Boot.
Pass this profile as an argument when you launch the Spring Boot application.
Set active the active profile in application.properties file.
xxxxxxxxxx
@Profile("dev")
@Bean
public String devBean() {
return "dev";
}
@Profile("qa")
@Bean
public String qaBean() {
return "qa";
}
@Profile("prod")
@Bean
public String prodBean() {
return "prod";
}