Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 880
GBP Avatar asked Jul 18 '13 22:07

GBP


1 Answers

Now everything is becoming better. I see both maven dependency plugin and assembly plugin correctly supporting symlinks. Following versions and definitions are used:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.10</version>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.5.4</version>
</plugin>
like image 131
Roman Nikitchenko Avatar answered Oct 19 '22 22:10

Roman Nikitchenko