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

 

全部评论

相关推荐

求个付费实习岗位:这种就是吃满时代红利又没啥技术水平,只能靠压力学生彰显优越感的老登,别太在意了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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