Use wildcard to copy folders using maven-assembly-plugin

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

Lib oracle lib lib mysql libserver.

and each folder contains some jar files.

I want to copy these folders (as well as their contents) into the final .tar.gz file. I know that I can copy them separately as follows:

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

but I am interested to know if there is a way to copy them all together?
maybe something like this:

 <fileSet> <directory>target/lib*</directory> </fileSet> 
+6
source share
4 answers

Finally, I managed to do this:

 <fileSet> <directory>target</directory> <includes> <include>lib*/*</include> </includes> <outputDirectory>/</outputDirectory> </fileSet> 
+11
source

You can do

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

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

+2
source

You can use:

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

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

+1
source

I checked this configuration

 <include>**/*</include> 

and copies all the subfolders and files in the subfolder except the empty subfolder. I think this is logical and sufficient.

0
source

Source: https://habr.com/ru/post/916879/


All Articles