问题描述
得到了以下的build.xml字符串:
Got a following build.xml string:
<jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" />
我是新来的蚂蚁,我不知道如何的不包括的字符串的作品。哪些文件受到影响?所有的Java源文件?
I am new to Ant and i don't understand how excludes string works. What files are affected? All java source files?
感谢。
推荐答案
一是有关语句
<jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" />
这目标是用来打包jar归档内文件
this target is used to package your files inside a jar archive
destfile:指定名称和目标文件的位置,这将要创建的归档
destfile : specifies the name and location of the destination file, the archive that would be created
BASEDIR:指定需要打包的文件的基本目录。注意,所有的文件和子文件夹将列入
basedir : specifies the base directory of the files that needed to be packaged. note that all files and subfolders would be included
不包括:这是用来排除BASEDIR,你不需要你的包内的文件(JAR)
excludes : this is used to exclude files from basedir that you dont need inside your package (jar)
现在您的问题
什么上面的语句会做的是,它会里面classes.src所有文件打包到$(lib.dir)/rpt.jar,但将排除在或BASEDIR的任何子文件夹中找到的任何.java文件。
what the above statement would do is that it will package all the files inside classes.src to $(lib.dir)/rpt.jar but will exclude any .java files found at or inside any sub folder of basedir.
编辑:
这排除=*的 / 的的.java一般做排除来源$ C $ C形成将被使用,分布在罐子,出口等
EDIT :This exclude="*/.java" is generally done to exclude source code form the jar which would be used, distributed,exported etc
这篇关于蚂蚁&LT;&罐子GT;任务:使用排除参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!