Enhancement for Conditional Annotations: When creating Auto Configurations we need to rely on @ConditionalOnProperty. This new annotation @ConditionalOnAnnotation serves as utility for conditional configuration with a custom enable annotation or an already existing annotation and acts similar to @ConditionalOnProperty but with annotation.
Comment From: snicoll
@rajvimalc thanks for the PR. Please build locally before submitting as each commit to fix checkstyle, format or any other build checks trigger a new notification to all watchers of this repository.
Comment From: rajvimalc
@snicoll Where can I get checkstyle configurations for spring-boot? My local does not show any error since its not configured for spring builds.
Comment From: snicoll
@rajvimalc please run the build on the command line and not only in your IDE. That will make sure all the checks defined by the build are passing upfront. More details on the contributing page.
Comment From: rajvimalc
@snicoll Thank you for the guidance. Fixed all the issues and pushed a commit.
Comment From: philwebb
Thanks very much for the PR @rajvimalc, but I'm afraid we're not keen to add this functionality to Spring Boot itself. We've generally found it better to try and test on the outcome of annotations, rather than the presence of the annotations themselves. For example, if you have an @Enable[Feature]
annotation, we prefer to use @ConditionalOnBean
to look for presence of some [Feature]Bean
that the @Enable
annotation created. We also generally don't add @Condition
annotations that we don't directly use ourselves in the Spring Boot codebase.
Thanks anyway for the effort that you put into the PR and I'm sorry we didn't get to discuss this before you started.
Comment From: rajvimalc
@philwebb Okay... Thank you for looking into it.