title: How can I exclude empty folders with Asciidoctor maven plugin
body: <p>I use Asciidoctor Maven Plugin for generating HTML from adoc. Unfortunately it copies every source directory from the directory specified in <code>sourceDirectory</code>. How can I exclude these empty folders?</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.asciidoctor&lt;/groupId&gt;
      &lt;artifactId&gt;asciidoctor-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.5.3&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;test-id&lt;/id&gt;
              &lt;phase&gt;generate-resources&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;process-asciidoc&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;sourceDirectory&gt;mysourcedirectory&lt;/sourceDirectory&gt;
                  &lt;sourceDocumentName&gt;Test.adoc&lt;/sourceDocumentName&gt;
                  &lt;outputDirectory&gt;${project.build.directory}/outputdir&lt;/outputDirectory&gt;
                  &lt;relativeBaseDir&gt;true&lt;/relativeBaseDir&gt;
                  &lt;preserveDirectories&gt;true&lt;/preserveDirectories&gt;
                  &lt;backend&gt;html&lt;/backend&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>My input dir looks like this:</p>
  
  <pre><code> ── mysourcedirectory
      ├── Test.adoc  
      └── subfolder1
          ├── doc1.adoc    
          └── doc2.adoc
  </code></pre>
  
  <p>The output of asciidoc looks like this (<code>subfolder1</code> is empty and I want it to be excluded):</p>
  
  <pre><code> ── mysourcedirectory
      ├── Test.adoc  
      └── subfolder1
  </code></pre>
  
  <p>According to the documentation of Asciidoc (<a href="https://github.com/asciidoctor/asciidoctor-maven-plugin#configuration-options" rel="nofollow">https://github.com/asciidoctor/asciidoctor-maven-plugin#configuration-options</a>), I can do it with <code>resources</code> tag. I've tried it this way, but it's not working:</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;includes&gt;
                  &lt;include&gt;**/*.*&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
  ...
  &lt;/configuration&gt;
  </code></pre>