title: Maven : copy files without subdirectory structure
body: <p>I am trying to use Maven to move all the *.xsd files contained in a given folder to another one, but without the source subdirectory structure.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.3&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;move-schemas&lt;/id&gt;
              &lt;phase&gt;generate-sources&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;resources&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;outputDirectory&gt;${basedir}/schemas-target&lt;/outputDirectory&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  
  ...
  
  &lt;resources&gt;
      &lt;resource&gt;
          &lt;directory&gt;${basedir}/schemas-source&lt;/directory&gt;
          &lt;includes&gt;
              &lt;include&gt;**/*.xsd&lt;/include&gt;
          &lt;/includes&gt;
      &lt;/resource&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>And it is (almost) working.  The only problem is that it keeps the source subdirectory structure, while I need to remove that hierarchy and put all the xsd files in the target folder. Example:</p>
  
  <p>This is what I have in the schemas-source folder:</p>
  
  <pre><code>schemas-source
   │- current
   │    │- 0.3
   │        │- myfile.xsd
   │- old
        │- 0.2
            │- myfile-0.2.xsd
  </code></pre>
  
  <p>and this is what I'd need in the schemas-target folder:</p>
  
  <pre><code>schemas-target
   │- myfile.xsd
   │- myfile-0.2.xsd
  </code></pre>