在build中配置resources,防止资源导出失败的问题

Mybatis 项目中xml导入失败解决方法 (在build中配置resources,来防止我们资源导出失败的问题)  

  在Mybatis中导入xml文件不能正确导入报错:

Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/lzk/dao/UserMapper.xml

//只需在pom.xml里面加入下面的代码即可~

<!--在build中配置resources , 来防止我们资源导出失败的问题--> <build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> </resource> </resources> </build>

 

posted @ 2021-09-30 09:16  meteor119  阅读(423)  评论(0编辑  收藏  举报