Spring Profile annotation allows you to select profiles. However if you read documentation it only allows you to select more than one profile with OR operation. If you speci
Another kind of trick but might work in many scenarios is put @Profile annotation on @Configuration and the other @Profile on @Bean - that creates logical AND between 2 profiles in java-based spring config.
@Configuration
@Profile("Profile1")
public class TomcatLogbackAccessConfiguration {
@Bean
@Profile("Profile2")
public EmbeddedServletContainerCustomizer containerCustomizer() {