title: Maven assembly plugin not creating tar files with directory entries?
body: <p>I'm working on my first Maven project which will ultimately package a Java app in a Debian package (using the jdeb plugin).  I'm trying to use the assembly plugin to build a tar file, but it looks like the generated file does not always include directory entries, which will cause dpkg install to fail. </p>
  
  <p>Has anyone seen this before?</p>
  
  <p>Specifically, the generated tar file does not include directory entries for:</p>
  
  <ul>
  <li>a fileSet that specifies <code>&lt;includes&gt;</code> (leaving <code>&lt;includes&gt;</code> will result in a directory entry int he tar file)</li>
  <li>a dependencySet</li>
  </ul>
  
  <p>Here's an assembly file that doesn't use the <code>&lt;includes&gt;</code></p>
  
  <pre><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;simple&lt;/id&gt;
  &lt;formats&gt;
      &lt;format&gt;tar&lt;/format&gt;
  &lt;/formats&gt;
  &lt;includeBaseDirectory&gt;false&lt;/includeBaseDirectory&gt;
  
  &lt;moduleSets&gt;
  &lt;/moduleSets&gt;
  &lt;fileSets&gt;
      &lt;fileSet&gt;
          &lt;directory&gt;src/main/config&lt;/directory&gt;
          &lt;outputDirectory&gt;/etc/${project.artifactId}&lt;/outputDirectory&gt;
  
      &lt;/fileSet&gt;
  &lt;/fileSets&gt;
  
  &lt;dependencySets&gt;
  
      &lt;dependencySet&gt;
          &lt;outputDirectory&gt;/usr/lib/${project.artifactId}/lib&lt;/outputDirectory&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;useProjectArtifact&gt;true&lt;/useProjectArtifact&gt;
      &lt;/dependencySet&gt;
  
  &lt;/dependencySets&gt;
  &lt;repositories&gt;
  &lt;/repositories&gt;
  &lt;componentDescriptors /&gt;
  &lt;/assembly&gt;
  </code></pre>
  
  <p>Here are the contents of the tar file:</p>
  
  <pre><code> tar tvf assembly-test-0.0.1-SNAPSHOT-simple.tar
  drwxr-xr-x 0/0               0 2012-04-10 12:54 etc/assembly-test/
  -rw-r--r-- 0/0               0 2012-04-10 12:52 etc/assembly-test/file1.xml
  -rw-r--r-- 0/0               0 2012-04-10 12:52 etc/assembly-test/file2.xml
  -rw-r--r-- 0/0            2131 2012-04-10 13:26 usr/lib/assembly-test/lib/assembly-test-0.0.1-SNAPSHOT.jar
  </code></pre>
  
  <p>Now if I use an assembly with some include patterns:</p>
  
  <pre><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;include-match&lt;/id&gt;
  &lt;formats&gt;
      &lt;format&gt;tar&lt;/format&gt;
  &lt;/formats&gt;
  &lt;includeBaseDirectory&gt;false&lt;/includeBaseDirectory&gt;
  
  &lt;moduleSets&gt;
  &lt;/moduleSets&gt;
  &lt;fileSets&gt;
      &lt;fileSet&gt;
          &lt;directory&gt;src/main/config&lt;/directory&gt;
          &lt;outputDirectory&gt;/etc/${project.artifactId}&lt;/outputDirectory&gt;
          &lt;includes&gt;
              &lt;include&gt;*.xml&lt;/include&gt;
          &lt;/includes&gt;
      &lt;/fileSet&gt;
  &lt;/fileSets&gt;
  
  &lt;dependencySets&gt;
  
      &lt;dependencySet&gt;
          &lt;outputDirectory&gt;/usr/lib/${project.artifactId}/lib&lt;/outputDirectory&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;useProjectArtifact&gt;true&lt;/useProjectArtifact&gt;
      &lt;/dependencySet&gt;
  
  &lt;/dependencySets&gt;
  &lt;repositories&gt;
  &lt;/repositories&gt;
  &lt;componentDescriptors /&gt;
  &lt;/assembly&gt;
  </code></pre>
  
  <p>The contents of the tar file loses the directory entry:</p>
  
  <pre><code>tar tvf assembly-test-0.0.1-SNAPSHOT-include-match.tar
  -rw-r--r-- 0/0               0 2012-04-10 12:52 etc/assembly-test/file1.xml
  -rw-r--r-- 0/0               0 2012-04-10 12:52 etc/assembly-test/file2.xml
  -rw-r--r-- 0/0            2131 2012-04-10 13:26 usr/lib/assembly-test/lib/assembly-test-0.0.1-SNAPSHOT.jar
  </code></pre>
  
  <p>This seems like a bug in the assembly plugin, though I'm still experimenting with it.  I can certainly work around it (use a preinst script in the package, maybe build out a directory structure for jdeb to build from), but I'd love to keep as much as possible in the descriptor file.</p>