我需要指定要排除的特定文件列表,但是当我尝试 excludesfile="file1, file2"
之类的操作时,执行任务时出现错误:
C:\Users.....\Desktop\testProject\project.build.xml:49: Excludesfile C:\Users......\Desktop\testProject\file1, file2 not found.
这是我的代码:
<target name="jar" depends="common.jar">
<zip
destfile="${jar.build.dir}/some-jar.jar"
basedir="${base.dir}"
includes="src/**,gradle/**"
excludesfile="file1,file2">
</zip>
</target>
最佳答案
excludesfile
用于指定一个文件,其中包含要在 zip
进程中排除的文件列表(每个文件位于单独的行上)。要将列表指定为逗号(或空格)分隔的文件,请使用 excludes
参数。例如:
excludes="file1,file2"
关于java - 如何在 ant zip 任务中使用 exceptsfile/includesfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30552279/