【发布时间】:2014-06-10 22:20:08
【问题描述】:
我目前正在处理一个现有项目,该项目有一个 pom.xml 文件,其中包含以下内容:
<resources>
<resource>
<filtering>false</filtering>
<directory>src</directory>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
我在基本路径中有一个名为 properties 的目录,其中包含属性文件。我想在打包我的src目录下properties/下的所有属性文件时复制(否则程序会因为缺少配置文件而崩溃)。
所以我的问题是:
如何使用 Maven 包含不在 src 目录下的资源文件?
我尝试了这个,但它似乎不起作用:
<resources>
<resource>
<filtering>false</filtering>
<directory>src</directory>
<includes>
<include>**/*.properties</include>
<include>../properties/**</include>
</includes>
</resource>
</resources>
感谢您的帮助。
【问题讨论】: