How to exclude some of the folders when creating a zip file through maven

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembl/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> <id>bin</id> <baseDirectory>/</baseDirectory> <formats> <format>zip</format> </formats> <fileSets> <fileSet> <directory>src/main</directory> <outputDirectory>/</outputDirectory> <excludes> <exclude>src/main/dml</exclude> </excludes> </fileSet> </fileSets> </assembly> 

This is my assemble.xml and src / main contains several folders, I want to exclude several folders, for example src / main / dml but this does not exclude the folder.

+6
source share
1 answer

Try this for exceptions:

  <excludes> <exclude>src/main/dml/**</exclude> </excludes> 

to match all contents of a folder and its subfolders

UPDATE: Oh, sorry, your exceptions apply to your directory, so you need to

  <excludes> <exclude>dml/**</exclude> </excludes> 
+14
source

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


All Articles