The error may exist in com/kuang/dao/UserMapper.xml
作者:互联网
问题原因:在java包下创建了xml文件,但是maven运行时候是找的resource文件下的配置文件,不能导入java包下的配置文件,
解决办法:
pom文件中添加配置信息,就能找到配置文件了:
<!--在build中配置文件resources,来防止我们资源导出失败的问题-->
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
标签:xml,src,java,配置文件,may,kuang,main,true 来源: https://blog.csdn.net/zhanlong11/article/details/115048663