在main的启动类上添加

@SpringBootApplication(scanBasePackages = {"com.shangsheng"})
或者
@ComponentScan("com.shangsheng")
注意:只能写两个包的连接点,不能写到最低包,不然扫描不到

相关文章:

  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2021-07-02
  • 2022-01-08
  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-09
  • 2021-11-18
  • 2022-12-23
  • 2021-08-08
  • 2021-08-17
相关资源
相似解决方案