【谷粒学院】Maven加载问题

问题

maven加载项目时候,默认不会加载src-java文件夹里面xml类型文件的

解决方案

  • 直接赋值xml文件到target目录
  • 通过配置实现
    (1)在pom.xml文件中配置
xml 复制代码
<!-- 项目打包时会将java目录中的*.xml文件也进行打包 -->
<build>
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.xml</include>
            </includes>
            <filtering>false</filtering>
        </resource>
    </resources>
</build>

(2)在application.properties中进行配置

c 复制代码
#配置mapper xml文件的路径
mybatis-plus.mapper-locations=classpath:com/guli/edu/mapper/xml/*.xml

配置完成后,重新运行项目在target中会出现xml类型文件

相关推荐
多云几多1 天前
Yudao单体项目 springboot Admin安全验证开启
java·spring boot·spring·springbootadmin
Jabes.yang1 天前
Java求职面试实战:从Spring Boot到微服务架构的技术探讨
java·数据库·spring boot·微服务·面试·消息队列·互联网大厂
聪明的笨猪猪1 天前
Java Redis “高可用 — 主从复制”面试清单(含超通俗生活案例与深度理解)
java·经验分享·笔记·面试
兮动人1 天前
Spring Bean耗时分析工具
java·后端·spring·bean耗时分析工具
MESSIR221 天前
Spring IOC(控制反转)中常用注解
java·spring
摇滚侠1 天前
Spring Boot 3零基础教程,Demo小结,笔记04
java·spring boot·笔记
笨手笨脚の1 天前
设计模式-迭代器模式
java·设计模式·迭代器模式·行为型设计模式
spencer_tseng1 天前
Eclipse 4.7 ADT (Android Development Tools For Eclipse)
android·java·eclipse
聪明的笨猪猪1 天前
Java Spring “AOP” 面试清单(含超通俗生活案例与深度理解)
java·经验分享·笔记·面试
seven97_top1 天前
Springboot 常见面试题汇总
java·spring boot·后端