将MyBatis Mapper xml 放到 jar 包外面

在不改程序的情况下,修改 sql 时,需要将 Mapper 中的 XML 文件 放到外面

mybatis:
    mapper-locations: classpath:mapper/*.xml #JAR 包里面

mybatis:
    mapper-locations: file:mapper/*.xml # classpath 改成 file mapper和jar包同级目录的一个文件 存放xml配置文件,也可以是绝对路径

posted @ 2021-07-08 15:09  VipSoft  阅读(1470)  评论(4编辑  收藏  举报