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

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 17:34:33

问题


<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.


回答1:


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>


来源:https://stackoverflow.com/questions/16214086/how-to-exclude-some-of-the-folders-while-creating-zip-file-through-maven

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!