mybatis-plus没有将XML配置文件放到classpath路径下的解决办法

1.需求:我将mapper接口对应的xml文件没有放到resources路径下,而是放到了如下图中,导致无法识别

1.1 默认可以放mapper对应配置文件的位置

1.2 本人实际放置的mapper对应的xml文件位置

2.解决:

2.1 第一步:在pom文件中添加如下配置

  <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>

2.2 在springboot配置文件中指定mapper对应的配置文件的位置

mybatis-plus.mapper-locations=com/xurong/mybatis/page/mapper/xml/*.xml

本文作者:远道而重任

本文链接:https://www.cnblogs.com/rong-xu-drum/p/17346948.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   远道而重任  阅读(265)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.