Skip to content

Default @ComponentScan's exclude filter to exclude @Configuration annotated classes [SPR-8880] #13521

Closed
@spring-projects-issues

Description

@spring-projects-issues

Oliver Drotbohm opened SPR-8880 and commented

Suppose you have an application with a base package of com.acme with an @Configuration class located in this package. Now suppose you use this configuration class as basePackageClass inside @ComponentScan. This will result in an exception saying the class is registered twice. So you pretty much end up with always adding this exclude.

Would it make sense to default the excludeFilters attribute of the @ComponentScan annotation as follows?

@Filter(type = FilterType.ANNOTATION, value = Configuration.class)

Affects: 3.1 RC2

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions