You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@ComponentScan should get processed without @Configuration as well [SPR-11769] #16391
I think Adam means that you can't use @ComponentScan unless it's on a @Configuration class so the additional @Configuration annotation is somewhat unnecessary. We could add a @Configuration meta-annotation annotation to @ComponentScan so you can do this:
@ComponentScan// @Configuration (no longer required)public ....
This is somewhat along the lines of #15163 and could be addressed the same way: through extending the 'lite' candidate check in ConfigurationClassutils.isLiteConfigurationCandidate, just making the class-level annotations work but not implying @Configuration semantics.
Since we're doing this for @Import already (as per #15163), we should consider it for @ImportResource and @ComponentScan as well.
Activity
spring-projects-issues commentedon May 9, 2014
Stéphane Nicoll commented
I am not sure what you are referring to. Are you saying that if you include
@ComponontScanit does not work unless you add@Configuration?spring-projects-issues commentedon May 9, 2014
Phil Webb commented
I think Adam means that you can't use
@ComponentScanunless it's on a@Configurationclass so the additional@Configurationannotation is somewhat unnecessary. We could add a@Configurationmeta-annotation annotation to@ComponentScanso you can do this:spring-projects-issues commentedon May 9, 2014
Phil Webb commented
I'm not totally sold on the idea, although you could argue that
@Configurationis superfluous I think it does help with readability.spring-projects-issues commentedon May 9, 2014
Juergen Hoeller commented
This is somewhat along the lines of #15163 and could be addressed the same way: through extending the 'lite' candidate check in ConfigurationClassutils.isLiteConfigurationCandidate, just making the class-level annotations work but not implying
@Configurationsemantics.Since we're doing this for
@Importalready (as per #15163), we should consider it for@ImportResourceand@ComponentScanas well.Juergen
spring-projects-issues commentedon May 9, 2014
Adam Berlin commented
@Philthanks for the clarification. That's exactly what I meant.