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
Allow Application Server to Supply Annotation Scanning [SPR-10354] #14986
in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement
These days every container has to do component scanning because more or less every EE specification — even servlets — requires the application server to discover classes annotated in a special way.
Since the application server controls the class loaders and deployments it's able to do so in an a reliable, stable and possibly more performant way compared to Spring. As application severs are beginning to fight over start up performance this an area that receives a lot of attention. Some like JBoss even go so far as to allow you to provide an index build at compile time to speed this up even further.
As Spring has always been about taking advantage of services provided by applications servers in a portable way that doesn't lock you in I think you would be a great feature.
We could consider such an index file as an explicit hint to Spring's component scanning, parsed through specific Jandex etc adapters. While this wouldn't be completely transparent e.g. simply through running on WildFly, it would at least allow for reusing an existing application server index. More importantly, it would also allow for building custom applications with a common index file that can be understood by Spring as well as Hibernate ORM and others...
With spring-context-indexer and AOT processing, it looks externally provided annotation scanning is not in demand anymore, in particular not in a Spring Boot environment.
in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement
Activity
spring-projects-issues commentedon Jun 25, 2016
Juergen Hoeller commented
Jandex (now at https://github.com/wildfly/jandex) is still the most common option here. An alternative would be ClassIndex (https://github.com/atteo/classindex).
We could consider such an index file as an explicit hint to Spring's component scanning, parsed through specific Jandex etc adapters. While this wouldn't be completely transparent e.g. simply through running on WildFly, it would at least allow for reusing an existing application server index. More importantly, it would also allow for building custom applications with a common index file that can be understood by Spring as well as Hibernate ORM and others...
jhoeller commentedon Jul 12, 2023
With spring-context-indexer and AOT processing, it looks externally provided annotation scanning is not in demand anymore, in particular not in a Spring Boot environment.