Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use wildcard to copy folders using maven-assembly-plugin

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>
like image 991
Saeed Avatar asked May 29 '12 06:05

Saeed


3 Answers

finally I was successful to do it:

<fileSet>
        <directory>target</directory>
        <includes>
            <include>lib*/*</include>
        </includes>
        <outputDirectory>/</outputDirectory>
    </fileSet>
like image 75
Saeed Avatar answered Nov 08 '22 08:11

Saeed


You can do

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

Even this will allow you to get all the data from inside target folder.

like image 41
Shah Avatar answered Nov 08 '22 06:11

Shah


You can use:

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

'**' indicates all the files in the current folder and all the files in the subfolders of the current folder.

like image 1
polavishnu Avatar answered Nov 08 '22 08:11

polavishnu