title: How can I tell Spring to scan for a given annotation without annotating that annotation with @Component?
body: <p>I have a collection of classes which I want to be injected into the Spring application context. However, these classes can only be guaranteed to be annotated with one of a group of annotations I have written - i.e. I can assume it will be annotated with @MyAnnotation, but not @Component.</p>
  
  <p>However, @MyAnnotation forms part of an API for my project, and I don't want to state an explicit dependency of this API on Spring. Thus, I can't annotate @MyAnnotation with @Component in order to have it be transitively picked up by Spring.</p>
  
  <p>Is there a way to tell Spring to additionally include @MyAnnotation in its classpath scanning without adding this dependency to my API?</p>
  
  <p>Currently I'm manipulating the bean definition registry to 'manually' add each class annotated with @MyAnnotation, but I'd prefer to rely on Spring's inbuilt support.</p>
  
  <p>Thanks in advance.</p>