使用maven程序集插件解压缩tar时如何保留符号链接 [英] How to preserve symlinks when unpacking tar using maven assembly plugin

查看:123
本文介绍了使用maven程序集插件解压缩tar时如何保留符号链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Maven程序集描述符,任务之一是下载一个tar文件,解压缩该文件,然后再使用许多组件创建最终的tarball.

I am writting a maven assembly descriptor and one of the task is to download a tar file, unpack it before creating a final tarball out of many components.

我不知道如何使用maven程序集插件保留tar中的符号链接.有人看过这个问题吗?

I cant figure out how to preserve symlinks from the tar using the maven assembly plugin. Has anybody seen this issue before?

<assembly>
    <id>myassembly</id>
    <formats>
            <format>dir</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
            <dependencySet>
                    <useProjectArtifact>false</useProjectArtifact>
                    <outputDirectory>.</outputDirectory>
                    <unpack>true</unpack>
            </dependencySet>
    </dependencySets>

</assembly>

推荐答案

momenet上的任何maven插件都不支持保留符号链接.我通过使用maven executor插件解决了这个问题,该插件将为我练习shell脚本以及tar和untar工件.

Preserving symlinks is not supported in any of the maven plugins at the momenet. I got around this problem by using the maven executor plugin that would execulte a shell script and tar and untar artifacts for me.

这篇关于使用maven程序集插件解压缩tar时如何保留符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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