1.找到springboot 启动类中 @ComponentScan注解
@SpringBootApplication
@MapperScan(basePackages = "com.wl.mapper")
@ComponentScan(basePackages = {"com.wl","org.n3r.idworker"})
@EnableScheduling
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
2.Ctrl 点击打开源码
3.@ComponentScan(basePackages = {“com.imooc”,“org.n3r.idworker”})
可以扫描多个包以及子包