我需要指定要排除的特定文件的列表,但是当我尝试类似excludesfile="file1, file2"
的操作时,执行任务时出现错误,提示:
C:\ Users ..... \ Desktop \ testProject \ project.build.xml:49:排除文件C:\ Users ...... \ Desktop \ testProject \ file1,找不到file2。
这是我的代码:
<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任务中使用excludesfile/includesfile,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30552279/