gpt4 book ai didi

ant - 使用 ANT 解压/解压 *.tar.xz

转载 作者:行者123 更新时间:2023-12-02 00:00:05 24 4
gpt4 key购买 nike

我想用 ant 提取一个包含 *.tar.xz 的 tarball 文件。

但我只能找到,bunzip2、gunzip、unzip 和 untar 作为 ant 中的目标,但似乎都不起作用。

那么如何使用 ant 扩展带有 *.tar.xz 的 tarball 文件呢?

最佳答案

默认的 Ant 发行版不支持 XZ 格式,您需要 Apache Compress Antlib .

here 下载包含所有依赖项的完整 Antlib (在 ant 的 ant-compress 目录中添加三个 jar common-compressxzlib ),并使用此任务:

<target name="unxz">
<cmp:unxz src="foo.tar.xz" xmlns:cmp="antlib:org.apache.ant.compress"/>
<untar src="foo.tar" dest="."/>
<delete file="foo.tar"/>
</target>

您必须使用这个两步过程,因为即使使用附加的 ant 库,"xz" compression 仍然不支持该值untar 的属性任务,通常用于提取压缩 tars 的任务。

关于ant - 使用 ANT 解压/解压 *.tar.xz,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31603742/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com