【问题标题】:How to get resource values from the POM如何从 POM 中获取资源值
【发布时间】: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


    【解决方案1】:

    我突然解决了这个问题! properties-maven-plugin 解决了我的问题!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-09
      • 2020-05-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多