需要在pom.xml文件中配置resource,不然mapper.xml文件就会被漏掉!
然后就在pom.xml的<build>中配置了resource:
<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 --><resources><resource><directory>src/main/java</directory><includes><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>false</filtering></resource><resource><directory>src/main/resources</directory><includes><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>false</filtering></resource></resources>
以上问题解决