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
Yet another option is to play on the Class/Method level allowed by the @Profile
annotation. Not as flexible as implementing MyProfileCondition
but quick and clean if it suits your case.
e.g. this won't start when FAST & DEV are both active, but will if only DEV is:
@Configuration
@Profile("!" + SPRING_PROFILE_FAST)
public class TomcatLogbackAccessConfiguration {
@Bean
@Profile({SPRING_PROFILE_DEVELOPMENT, SPRING_PROFILE_STAGING})
public EmbeddedServletContainerCustomizer containerCustomizer() {