springboot的mapper.xml在src下问题

 

在pom.xml里面的build标签加上resources说明

<resources>
    <!-- mapper.xml文件在java目录下 -->
    <resource>
        <directory>src/main/java</directory>
        <includes>
            <include>**/*.xml</include>
        </includes>
    </resource>
    <!-- mapper.xml文件在resources目录下-->
    <resource>
        <directory>src/main/resources</directory>
    </resource>
</resources>

 

然后在application.yml中声明mapper.xml具***置

mybatis:
    mapper-locations: classpath:com/xiaostudy/test/mapper/xml/*.xml

 

全部评论

相关推荐

zzzilik:四个月实习做了3个项目不觉得很假吗,真没必要写这么多吧我感觉挑点核心的重点写一下我感觉会好点
你的简历改到第几版了
点赞 评论 收藏
分享
做黑夜里的那道光:两年电赛完赛没必要写,纯扣分
双非本科求职如何逆袭
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务