异常:Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.qbb.srb.core.mapper.DictMapper.batchInsert

程序报错:Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.qbb.srb.core.mapper.DictMapper.batchInsert

今天使用mybatis出现了,第一反应是没扫描mapper包,然后去查看发现我写了.mapper目录结构如下
image

然后打开target-->classes查看我的xml文件根本没编译到mapper包中
image

解决办法:在pom.xml中加入如下的配置即可

<build>
    <!-- 项目打包时会将java目录中的*.xml文件也进行打包 -->
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.xml</include>
            </includes>
            <filtering>false</filtering>
        </resource>
    </resources>
</build>
posted @ 2022-03-29 21:09  我也有梦想呀  阅读(99)  评论(0)    收藏  举报