spring boot 的 userRepository无法注入的问题

No qualifying bean of type 'xxx.xxx.xxx' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

在启动项上加上

@EnableJpaRepositories(basePackages = "com.ssm.xxx")
扫描到指定的包
原文地址:https://www.cnblogs.com/oldzhang1222/p/9447893.html