Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude some of the folders while creating 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. src/main contains several folders. I want to exclude some folders, like src/main/dml, but it is not being excluded.

like image 973
Sunil Rk Avatar asked Apr 25 '13 11:04

Sunil Rk


1 Answers

Try this for excludes:

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

to match all of the contents of the folder and its subfolders

UPDATE: oh I'm sorry, your excludes are relative to your directory, so what you want is

  <excludes>
            <exclude>dml/**</exclude>
  </excludes>
like image 83
Miquel Avatar answered Oct 17 '22 01:10

Miquel