springBoot 第三方 jar 包及 xml 扫描问题

版权声明: https://blog.csdn.net/qq_37143673/article/details/89713590

Application 启动类中配置包扫描

// 多个可以用 { } 包起来,里面逗号隔开
// 我这里是因为我的jar包的路径和项目中是一样的命名规则,所以直接就扫描到了
@ComponentScan(basePackages = {"com.springboot.*"})
@MapperScan("com.springboot.*.dao")

application.yml 配置 xml 扫描

这里配置了两个扫描路径

#配置xml映射
# classpath*:mapper/*.xml 是扫描引入的 jar 包中的xml
mybatis:
  mapper-locations: mapper/*/*.xml, classpath*:mapper/*.xml
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

猜你喜欢

转载自blog.csdn.net/qq_37143673/article/details/89713590
今日推荐