Skip to content

@Component not picked up by @ComponentScan if it has the same simple name as the main class #25952

Closed
@Drezir

Description

@Drezir

Hello,

I have accidentally named my worker @Component class same as my main application class with @SpringBootApplication and @ComponentScan annotations. I have correct structure by documentation because my main class is in root package and other classes are in sub-packages.

Seems like my @Component class is not being picked up by component scanning. It is in different package so I think this should work.

Spring version = 2.3.4.RELEASE.
Build tool = Gradle 6.6.1

Thanks.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions