蚂蚁<jar>任务:使用排除参数

编程入门 行业动态 更新时间:2024-10-28 08:16:07
本文介绍了蚂蚁<jar>任务:使用排除参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

得到以下 build.xml 字符串:

Got a following build.xml string:

<jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" />

我是 Ant 的新手,我不明白 excludes 字符串是如何工作的.哪些文件受到影响?所有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

excludes : 这用于从 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.

这个 exclude="*/.java" 通常用于从将使用、分发、导出等的 jar 中排除源代码

EDIT : This exclude="*/.java" is generally done to exclude source code form the jar which would be used, distributed,exported etc

这篇关于蚂蚁&lt;jar&gt;任务:使用排除参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-20 10:54:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/982830.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:蚂蚁   参数   amp   lt   jar

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!