问题 在springboot项目中通过maven引入了第三方jar,而第三方jar内使用了注解,比如:@Component、@Service、@Repository等,需要在项目启动时一起交给spring容器管理怎么解决 答案 在springboot启动类上的@SpringBootApplication(scanBasePackages = {“当前项目包扫描路径”,“第三方jar包扫描路径”})