今天带来SpringBoot整合Mybatis无法扫描xml文件的解决教程详解
网上说是使用idea在SpringBoot整合Mybatis时候会扫描不到xml文件
1.将xml文件放在resources下
2.在application.properties中配置xml文件的扫面
补充知识: Springboot整合mybatis /*.xml路径URl does not exist问题
解决一:
在配置文件下 扫描不到 xml文件:
原来的文件:
修改classpath 为 classpath*
解决二:
war包里面缺少Mapper对应的xml文件,也就是没有把xml文件打包进去。解决办法是,在pom.xml文件中的build标签中添加如下代码,显示的强制将xml文件打到war包中:
src/main/java **/*.xml false
以上这篇SpringBoot整合Mybatis无法扫描xml文件的解决就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
以上就是关于SpringBoot整合Mybatis无法扫描xml文件的解决全部内容,感谢大家支持。
查看更多关于SpringBoot整合Mybatis无法扫描xml文件的解决的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did18306