立即学习:https://edu.csdn.net/course/play/7907/162062?utm_source=blogtoedu
映射文件存储位置,两种方式:
- 将映射文件放在resources目录下会被打包部署
- 将映射文件放在Java目录下默认只会对该目录下对java代码进行打包部署,如果希望对该目录下对配置文件也进行打包,需要额外对配置
<!-- 将java目录下的配置文件也进行打包--> <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> <include>**/*.properties</include> </includes> <filtering>false</filtering> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.xml</include> <include>**/*.properties</include> </includes> <filtering>false</filtering> </resource> </resources> </build>