title: Maven clean ignore single file
body: <p>I have a Maven project that is an aggregation of a number of sub-projects.  This project uses the maven javadoc plugin to aggregate all sub-project javadocs into a single directory in the <code>target/</code> folder.  I have an additional file in the <code>target/</code> folder that I would like to remain in with the javadoc pages.  However, every time I run a <code>clean</code>, this file would be deleted.  I was wondering if there was a way to delete the whole target directory and leave only a single file.  My plugin is currently configured like so:</p>
  
  <pre><code>&lt;plugin&gt;
    &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
      &lt;execution&gt;
        &lt;executions&gt;
          &lt;id&gt;default-clean&lt;/id&gt;
          &lt;configuration&gt;
            &lt;excludeDefaultDirectories&gt;true&lt;/excludeDefaultDirectories&gt;
              &lt;filesets&gt;
                &lt;fileset&gt;
                  &lt;directory&gt;target&lt;/directory&gt;
                  &lt;excludes&gt;
                    &lt;exclude&gt;path/to/myFile.xml&lt;/exclude&gt;
                  &lt;/excludes&gt;
                  &lt;followSymlinks&gt;false&lt;/followSymlinks&gt;
                &lt;fileset&gt;
             &lt;/filesets&gt;
           &lt;/configuration&gt;
         &lt;phase&gt;initialize&lt;/phase&gt;
         &lt;goals&gt;
           &lt;goal&gt;clean&lt;/goal&gt;
         &lt;/goals&gt;
       &lt;/execution&gt;
     &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I saw a similar question <a href="https://stackoverflow.com/questions/5801439/maven-clean-plugin-exclude-cvsignore">here</a>, but the solution doesn't seem to work for me.</p>