title: Simulating the Maven2 filter mechanism using Ant
body: <p>I have a properties file, let say my-file.properties.
  In addition to that, I have several configuration files for my application where some information must be filled regarding the content of my-file.properties file.</p>
  
  <p>my-file.properties:</p>
  
  <pre><code>application.version=1.0
  application.build=42
  user.name=foo
  user.password=bar
  </code></pre>
  
  <p>Thus, in my configuration files, I will find some <code>${application.version}</code>, <code>${user.name}</code> that will be replaced by their value taken in the properties file...</p>
  
  <p>When I build my application using Maven2, I only need to specify the properties file and say that my resources files are filtered (as in <a href="https://stackoverflow.com/questions/1231561/how-to-share-common-properties-among-several-maven-projects/1231594#1231594">this answer</a> to another problem). However, I need to achieve the same thing by using only Ant.</p>
  
  <p>I've seen that Ant offers a <a href="http://ant.apache.org/manual/Tasks/filter.html" rel="nofollow noreferrer">filter task</a>. However, it forces me to use the pattern <code>@property.key@</code> (i.e. <code>@user.name@</code> instead of <code>#{user.name}</code>) in my configuration files, which is not acceptable in my case.</p>
  
  <p>How can I solve my problem?</p>