use wildcard to copy folders using maven-assembly-plugin

Saeed picture Saeed · May 29, 2012 · Viewed 15.3k times · Source

I am using maven-assembly-plugin to collect some files and folders in a .tar.gz file. In my target directory, I have some folders with these names (for example):

lib-oracle lib-mysql lib-sqlserver . .

and each folder contains some jar files.

I want to copy these folders (and also contents of them) into a final .tar.gz file. I know I can copy them separately like this:

<fileSet>
    <directory>target/lib-oracle</directory>
    <outputDirectory>lib-oracle</outputDirectory>
</fileSet>

but I'm interested to know if there is any way to copy them all together?
maybe something like this:

<fileSet>
    <directory>target/lib*</directory>
</fileSet>

Answer

Saeed picture Saeed · May 29, 2012

finally I was successful to do it:

<fileSet>
        <directory>target</directory>
        <includes>
            <include>lib*/*</include>
        </includes>
        <outputDirectory>/</outputDirectory>
    </fileSet>