Search code examples
mavenmaven-2maven-3maven-assembly-plugin

How to preserve symlinks when unpacking tar using maven assembly plugin


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.

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>

Solution

  • 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.