I have the below class which should be initialized only if active profile is not master. But it is being executed even if the active profile is master. How to implement this? I am using Spring boot and Spring 4.
@Component
@Scope(value= "singleton")
@Profile("!master")
public final class SystemStartUp implements ApplicationListener<ContextRefreshedEvent>, Ordered {
}