Skip to content

Allow Application Server to Supply Annotation Scanning [SPR-10354] #14986

Closed as not planned

Description

@spring-projects-issues

Philippe Marschall opened SPR-10354 and commented

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.


Issue Links:

0 votes, 5 watchers

Activity

  1. spring-projects-issues commented on Jun 25, 2016

    @spring-projects-issues
    CollaboratorAuthor

    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...

  2. added
    type: enhancement
    in: core
    on Jan 11, 2019
  3. jhoeller commented on Jul 12, 2023

    @jhoeller
    Contributor

    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.

  4. removed this from the 6.x Backlog milestone on Jul 12, 2023
  5. added
    status: declined
    on Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: corestatus: declinedtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions