我如何使用zipfileset src属性,而不必手动指定它为我所有的罐子? [英] How can I use a zipfileset src attribute without having to specify it manually for all my jars?

查看:382
本文介绍了我如何使用zipfileset src属性,而不必手动指定它为我所有的罐子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我有这样的:

 < jarjar destfile =a.jar文件清单=的MANIFEST.MF>
  < zipfileset SRC =first.jar/>
  < zipfileset SRC =second.jar/>
< / jarjar>

问题是我必须手动指定每个罐子,因为我需要考虑应采取的src参数。我想是这样的:

 < zipfileset>
   <包括姓名=*罐子。/>
< zipfileset>

和有自己的内容提取出来并包括在我的生成的存档。这可能吗?


解决方案

也许你可以先用合并的罐子:

 <拉链destfile =out.jar>
  < zipgroupfileset DIR =lib目录包括=*罐子。/>
< /拉链>

和指定的zipfileset合并后的罐子。

zipgroupfileset


  A< zipgroupfileset>允许多个zip文件合并成


  
  

存档。在这一发现的每个文件
  文件集被添加到档案中的
  这zipfileset SRC文件是相同的方式
  补充说。

 < zipgroupfileset>是一个文件集,并支持其所有属性和


  
  

嵌套元素。


I currently have this:

<jarjar destfile="a.jar" manifest="Manifest.mf">
  <zipfileset src="first.jar"/>
  <zipfileset src="second.jar"/>
</jarjar>

The problem is I have to manually specify each jar, because I need the src parameter to be taken in consideration. I would want something like this:

<zipfileset>
   <include name="*.jar"/>
<zipfileset>

And have their contents extracted and included in my resulting archive. Is this possible?

解决方案

Maybe you could merge the jars first with:

<zip destfile="out.jar">
  <zipgroupfileset dir="lib" includes="*.jar"/>
</zip>

and specify the merged jar in the zipfileset.

zipgroupfileset

A <zipgroupfileset> allows for multiple zip files to be merged into

the archive. Each file found in this fileset is added to the archive the same way that zipfileset src files are added.

<zipgroupfileset> is a fileset and supports all of its attributes and

nested elements.

这篇关于我如何使用zipfileset src属性,而不必手动指定它为我所有的罐子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆