我目前有这个:
<jarjar destfile="a.jar" manifest="Manifest.mf">
<zipfileset src="first.jar"/>
<zipfileset src="second.jar"/>
</jarjar>
问题是我必须手动指定每个 jar,因为我需要考虑 src 参数。我想要这样的东西:
<zipfileset>
<include name="*.jar"/>
<zipfileset>
并将它们的内容提取并包含在我生成的存档中。这可能吗?
最佳答案
也许您可以先将 jar 与以下内容合并:
<zip destfile="out.jar">
<zipgroupfileset dir="lib" includes="*.jar"/>
</zip>
并在 zipfileset 中指定合并的 jar。
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.
关于ant - 如何使用 zipfileset src 属性而不必为我的所有 jar 手动指定它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6291525/