title: Maven - how to delete contents of a folder during a clean phase?
body: <p>in my project I have a folder called <code>war</code>. It is initially empty and it's under version control. The folder gets populated by Maven during its <code>package</code> phase and Eclipse's WST plugin deploys the web app from this folder.</p>
  
  <p>What I want is to delete contents of the <code>war</code> folder during the <code>clean</code> phase but not the folder itself. How do I do that? So far I know how to delete the whole <code>war</code> folder:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.4.1&lt;/version&gt;
      &lt;configuration&gt;
          &lt;followSymLinks&gt;false&lt;/followSymLinks&gt;
          &lt;filesets&gt;
              &lt;fileset&gt;
                  &lt;directory&gt;${basedir}/war&lt;/directory&gt;
              &lt;/fileset&gt;
          &lt;/filesets&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>How do I delete only contents of the <code>war</code> folder but not the folder itself? I know that by adding some existing excludes, the folder won't be deleted. But how to generally delete only contents of a folder?</p>