2010-03-19 86 views
1

我有一些針對ant腳本的配置屬性文件。這些文件用於客戶定製。例如,ant應重命名temp_context.xmlcustomer_name_context.xml其中customer_name是conf中的一個屬性。文件。如何從POM獲取資源值

現在我想在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> 

當我試圖執行這個插件的財產$ {}客戶被沒有設置任何值。是否有可能在Maven運行時獲取資源值(沒有配置文件)?

回答