maven项目编译规则的更改配置——满足在同一目录

maven项目目录约定:
src/main/java:只能编译java代码
src/main/resources:编译配置文件
需求:为了满足Mybatis接口开发规范:接口和映射文件必须在同一个目录
方案:放行xml文件,让xml文件在src/main/java也能被编译
配置如下:在</project>标签下配置

<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>

« »

发表评论

电子邮件地址不会被公开。 必填项已用*标注

昵称 *