【发布时间】:2010-03-19 23:03:32
【问题描述】:
我有十几个用于 ant 脚本的配置属性文件。这些文件用于客户定制。例如,ant 应该将 temp_context.xml 重命名为 customer_name_context.xml,其中 customer_name 是 conf 中的一个属性。文件。
现在我想在 Maven 项目中重用相同的文件。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-files</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<filter filtersfile="${basedir}/config/config.filter.local" />
<copy todir="${project.build.directory}/${customer}" overwrite="yes" filtering="true">
</tasks>
<execution>
</execution>
当我尝试执行此插件时,属性 ${customer} 未设置为任何值。是否可以在 Maven 运行时(不带配置文件)中获取资源值?
【问题讨论】:
标签: maven-2 resources filtering