title: Exclude file directory, by assembly plugin MAVEN
body: <p>I would be pleasant, if you could help me to figure out this problem.</p>
  
  <p>When I build my project to .zip with maven &lt;<em>assembly</em>> plugin. </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"&gt;
  
  &lt;id&gt;dev&lt;/id&gt;
  &lt;formats&gt;
      &lt;format&gt;zip&lt;/format&gt;
  &lt;/formats&gt;
  
  &lt;fileSets&gt;
  
      &lt;fileSet&gt;
          &lt;directory&gt;${basedir}&lt;/directory&gt;
          &lt;includes&gt;
              &lt;include&gt;/environments/dev/**/*.sh&lt;/include&gt;
              &lt;include&gt;/environments/dev/**/*.jil&lt;/include&gt;
              &lt;include&gt;/environments/dev/**/*.properties&lt;/include&gt;
              &lt;include&gt;/environments/dev/**/log4j2.xml&lt;/include&gt;  
          &lt;/includes&gt;  
      &lt;/fileSet&gt;
  
  &lt;/fileSets&gt;
  
  &lt;dependencySets&gt;
      &lt;dependencySet&gt;
          &lt;outputDirectory&gt;/lib&lt;/outputDirectory&gt;
          &lt;useProjectArtifact&gt;true&lt;/useProjectArtifact&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependencySet&gt;
  &lt;/dependencySets&gt;
  </code></pre>
  
  <p></p>
  
  <p>I receive the following file structure:</p>
  
  <pre><code>build.zip----&gt; environments__
                              |_DEV_
                                    |_bin
                                    |_properties
                                    |_....
  </code></pre>
  
  <p>My <em>goal</em> is:</p>
  
  <p>To get the following file structure after maven build:</p>
  
  <pre><code> build.zip----&gt; 
                                    |_bin
                                    |_properties
                                    |_....
  </code></pre>
  
  <p>Without environments and DEV folders. </p>
  
  <p>I've read in the maven documentation (<a href="http://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html" rel="noreferrer">http://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html</a>) that we can exclude some file directories.
  This way:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;assembly&gt; 
      ....
  
      &lt;fileSets&gt; 
          &lt;fileSet&gt;
              &lt;directory&gt;${basedir}&lt;/directory&gt;
              &lt;includes&gt;
                ....
              &lt;/includes&gt;
              &lt;excludes&gt;
                  &lt;exclude&gt;/environments/dev&lt;/exclude&gt;
              &lt;/excludes&gt;
          &lt;/fileSet&gt; 
      &lt;/fileSets&gt;
  
      &lt;dependencySets&gt;
          &lt;dependencySet&gt;
              &lt;outputDirectory&gt;/lib&lt;/outputDirectory&gt;
              &lt;useProjectArtifact&gt;true&lt;/useProjectArtifact&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependencySet&gt;
      &lt;/dependencySets&gt;
  &lt;/assembly&gt;
  </code></pre>
  
  <p>But it doesn't help. I still have previous file structure.</p>