类似的问题:Can Ant's tar task set a Linux file permission even when the task is used on other platforms?
如果我使用带有'project'描述符的Maven 2程序集插件,有没有办法将shell脚本权限设置为可执行文件,例如包含的build.sh脚本文件?
例:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration>
<descriptorRefs>
<descriptorRef>project</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
这将创建三个文件
我想将tar文件中所有* .sh文件的文件权限设置为'executable'。
这可以使用Maven Assembly Plugin fileMode
中提供的assembly descriptor参数来完成。例如
<assembly>
...
<fileSets>
<fileSet>
<directory>${project.build.directory}/bin</directory>
<outputDirectory>/bin</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
...
</fileSets>
...
</assembly>
在评论中询问如何为目录设置permisions,以便它们不会以qazxsw poi权限结束。答案很简单 - 使用qazxsw poi:
d---------