springboot+mybatis 整合时扫描任意路径下的xxx.xml文件

classpath*  这个星加上即可,非常重要,我在这里踩了两次坑,记录一下

mybatis:
  config-location: classpath:mybatis/mybatis.cfg.xml        # mybatis配置文件所在路径
  mapper-locations:
  - classpath*:com/example/demo/**/dao/xml/*.xml                       # mapper映射文件

猜你喜欢

转载自my.oschina.net/u/3574106/blog/1803062