You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ex...@tietoenator.com on 2008/09/22 16:00:45 UTC

Excluding empty directories from assembly

Hi,

I'm using the maven assembly plugin to create an assembly of a source
tree.

My source tree sometimes contains empty directories (they have to be
there, don't ask!). Is there a way I can get the assembly plugin to
remove all empty directories from the assembly?

Here's my descriptor:

<assembly>
  <id>jrules-project-assembly</id>
  <formats>
    <format>zip</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <fileSets>
    <fileSet>
      <directory />
      <useDefaultExcludes>true</useDefaultExcludes>
      <includes>
        <include>*.xml</include>
        <include>*.sql</include>
        <include>*.js</include>
        <include>**/bom/**</include>
        <include>**/queries/**</include>
        <include>**/rules/**</include>
        <include>**/templates/**</include>
        <include>**/.ruleproject</include>
        <include>**/.project</include>
        <include>jrules-support/**</include>
      </includes>
      <excludes>
        <exclude>**/output/**</exclude>
        <exclude>**/target/**</exclude>
        <exclude>**/.rtserver/**</exclude>
        <exclude>**/.settings/**</exclude>
      </excludes>
    </fileSet>
</assembly>


Re: Excluding empty directories from assembly

Posted by Wayne Fay <wa...@gmail.com>.
You could probably add this functionality without much trouble and
make it configurable (boolean includeEmptyDirectories), then donate
the code back to Maven for inclusion in a future release of the
Assembly plugin.

Wayne

On Mon, Sep 22, 2008 at 7:00 AM,  <Ex...@tietoenator.com> wrote:
> Hi,
>
> I'm using the maven assembly plugin to create an assembly of a source
> tree.
>
> My source tree sometimes contains empty directories (they have to be
> there, don't ask!). Is there a way I can get the assembly plugin to
> remove all empty directories from the assembly?
>
> Here's my descriptor:
>
> <assembly>
>  <id>jrules-project-assembly</id>
>  <formats>
>    <format>zip</format>
>  </formats>
>  <includeBaseDirectory>false</includeBaseDirectory>
>  <fileSets>
>    <fileSet>
>      <directory />
>      <useDefaultExcludes>true</useDefaultExcludes>
>      <includes>
>        <include>*.xml</include>
>        <include>*.sql</include>
>        <include>*.js</include>
>        <include>**/bom/**</include>
>        <include>**/queries/**</include>
>        <include>**/rules/**</include>
>        <include>**/templates/**</include>
>        <include>**/.ruleproject</include>
>        <include>**/.project</include>
>        <include>jrules-support/**</include>
>      </includes>
>      <excludes>
>        <exclude>**/output/**</exclude>
>        <exclude>**/target/**</exclude>
>        <exclude>**/.rtserver/**</exclude>
>        <exclude>**/.settings/**</exclude>
>      </excludes>
>    </fileSet>
> </assembly>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org