Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven assembly plugin not applying fileMode on unpacked dependencySet

I have been banging my head against the wall all afternoon with this one. I need to create a pair of assemblies (zip and tgz) and need to set the correct executable permissions for shell scripts included in the archive.

It doesn't seem to make any difference what I do, the fileMode settings seem to have no effect. Here is a snippet from my assembly descriptor:

<dependencySet>
        <useProjectArtifact>false</useProjectArtifact>
        <useStrictFiltering>true</useStrictFiltering>
        <outputDirectory></outputDirectory>
        <unpack>true</unpack>
        <fileMode>0755</fileMode>
        <unpackOptions>
           <lineEnding>keep</lineEnding>
           <includes>
               <include>**/*.sh</include>
           </includes>
        </unpackOptions>
        <includes>
            <include>com.example:my-artifact:jar</include>
        </includes>
</dependencySet>

After untarring I do not see what I expect, e.g.

tar pxvf target/my-package-1.0.0-SNAPSHOT.tgz

I've tried with and without the p, but I still miss executable perms:

-rw-r--r--  1 MWard  staff  1468  3 Sep 09:58 a_script.sh

Any ideas as to where I may be going wrong? Thanks!

like image 387
pogul Avatar asked Oct 20 '22 03:10

pogul


1 Answers

This is a bug : https://issues.apache.org/jira/browse/MASSEMBLY-829

Solved in maven-assembly-plugin 3.0.0-SNAPSHOT

like image 71
Christophe Marchand Avatar answered Oct 24 '22 05:10

Christophe Marchand