You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Brian Wawok <br...@cmegroup.com> on 2011/05/17 18:40:55 UTC

maven assembly plugin - chmod question

Hi,

I am trying to use the maven-assembly plugin like so:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>

<descriptor>src/main/assembly/exportWithDepends.xml</descriptor>
                            </descriptors>
                            <finalName>myname</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


My assembly looks like:

<assembly>
    <id>jar-with-dependencies</id>
    <formats>
        <format>zip</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
        <dependencySet>
            <unpack>false</unpack>
            <scope>runtime</scope>
            <outputDirectory>lib</outputDirectory>
            <useProjectArtifact>true</useProjectArtifact>
            <fileMode>755</fileMode>
        </dependencySet>
    </dependencySets>
    <files>
        <file>

<source>${project.build.directory}/${project.build.finalName}.jar</source>
        </file>
    </files>
</assembly>



So the fileMode works on the sub-elements. Each item in my LIB director
gets a 755 CHMOD. But the actual LIB folder itself stays 777. Is there a
way to make the LIB folder also get a 755?

Thanks!

Antwort: maven assembly plugin - chmod question

Posted by Thorsten Heit <th...@vkb.de>.
Hi,

> My assembly looks like:
> 
> <assembly>
>     <id>jar-with-dependencies</id>
>     <formats>
>         <format>zip</format>
>     </formats>
>     <includeBaseDirectory>false</includeBaseDirectory>
>     <dependencySets>
>         <dependencySet>
>             <unpack>false</unpack>
>             <scope>runtime</scope>
>             <outputDirectory>lib</outputDirectory>
>             <useProjectArtifact>true</useProjectArtifact>
>             <fileMode>755</fileMode>
>         </dependencySet>
>     </dependencySets>
>     <files>
>         <file>
> 
> 
<source>${project.build.directory}/${project.build.finalName}.jar</source>
>         </file>
>     </files>
> </assembly>
> 
> 
> 
> So the fileMode works on the sub-elements. Each item in my LIB director
> gets a 755 CHMOD. But the actual LIB folder itself stays 777. Is there a
> way to make the LIB folder also get a 755?

What about <directoryMode>755</directoryMode> at the same hierarchy level 
as <fileMode>?

See http://maven.apache.org/xsd/assembly-1.1.2.xsd


Regards

Thorsten