title: How to replace a value in web.xml with a Maven property?
body: <p>I have a Maven project that downloads some test files into its build directory <code>./target/files</code>. These files should then be available to a servlet, which I can easily achieve by hardcoding the full path as an <code>&lt;init-param&gt;</code> of the servlet:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;TestServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;my.package.TestServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;filepath&lt;/param-name&gt;
          &lt;param-value&gt;/home/user/testproject/target/files&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/servlet&gt;
  </code></pre>
  
  <p>How can I avoid hardcoding the full path and use a dynamic parameter replacement instead? I tried the following, but it did not work:</p>
  
  <pre><code>&lt;param-value&gt;${project.build.directory}/files&lt;/param-value&gt;
  </code></pre>