IDEA+Maven:invalid bound statement (not found) 解决方法 Maven静态资源过滤问题

问题描述:

​ 之前在Eclipse中,maven打包部署完后一切正常,后来转到idea中开发,再用maven打包部署后,一直报 Invalid bound statement (not found)错误;
​ 检查后发现打出来的war包里没有mapper对应的xml文件。

原因:

Maven静态资源过滤问题

​ 没有在pom.xml文件中配置,mapper.xml文件就会被漏掉!

解决方法:

在build标签中加入:

<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>
posted @ 2020-09-27 15:39  酸黄瓜333  阅读(170)  评论(0)    收藏  举报