【发布时间】:2017-03-30 10:11:52
【问题描述】:
我需要在 maven pom.xml 中使用属性文件中的值,所以我使用 properties-maven-plugin 来读取我的属性文件,如下所示
pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/src/main/resources/qura.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
qura.properties 文件包含类似这样的内容..
config.file.path = resources/python/config/test.py
我需要在 pom.xml 的资源元素中使用这个 config.file.path 变量
pom.xml
<resources>
<resource>
<directory>${basedir}/multilang/</directory>
<includes>
<include>${config.file.path}</include>
</includes>
</resource>
<resources>
但是 ${config.file.path} 的值没有从 qura.properties 文件中占用,我在 jar 中找不到 test.py 文件。
我在这段代码中做错了什么?
提前致谢
【问题讨论】:
标签: maven pom.xml properties-file