Skip to content

ClassPathMapperScanner scan annotations in the package path as CandidateComponent. #1032

Closed

Description

@machimedes

I found ClassPathMapperScanner may scan annotations in the package path as CandidateComponent,
but CandidateComponent should not include annotation type.(Am I right?)

File: src/main/java/org/mybatis/spring/mapper/ClassPathMapperScanner.java.

Method isCandidateComponent of ClassPathMapperScanner should exclude annotation bean definition.

    protected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) {
        return beanDefinition.getMetadata().isInterface() && beanDefinition.getMetadata().isIndependent()
            && !beanDefinition.getMetadata().isAnnotation();
    }

Activity

  1. added a commit that references this issue on Jun 27, 2026
    82564eb
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions