I have an application which uses an existing spring annotation (`@EnableResourceServer`). I want this particular annotation to be enabled only when a particular property value is not false.
To do this, I created a meta-annotation and applied `@ConditionalOnProperty` on that :

```
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@ConditionalOnProperty(prefix = "custom.resource", name = "enabled", matchIfMissing = true)
@EnableResourceServer
public @interface EnableCustomResourceSecurity {
}

```

In my application I'm now using `@EnableCustomResourceSecurity` like :

```
@EnableCustomResourceSecurity
@SpringBootApplication
public class MyApplication {

    public static void main(String[] args) {
    SpringApplication.run(MyApplication.class, args);
    }

}

```

and it all works fine if the property is missing or true but when I change the property to `custom.resource.enabled=false` I get the following exception :

```
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

```

I tried putting this annotation in a couple of other places and noticed that when the conditional expression fails for this annotation, any annotation after this also stops getting processed.

What would be the correct way to achieve what I'm trying to do?