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

 

全部评论

相关推荐

10-26 13:03
已编辑
门头沟学院 物流经理
在okr拆解的小太阳...:实习待过,我待的部门氛围很好,基本不加班,双休有保证。
投递正浩创新EcoFlow等公司10个岗位
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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