maven程序集插件没有在某些文件集上应用filemode。在某些文件集上它可以工作,而在另一些文件集上则不行。
这是assembly.xml:
<assembly>
<id>
assembly
</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>src/main/resources/config/
</directory>
<outputDirectory>/config/</outputDirectory>
<excludes>
</excludes>
</fileSet>
<fileSet>
<directory>src/main/resources/excel/
</directory>
<outputDirectory>/excel/</outputDirectory>
<fileMode>0666</fileMode> <!-- WORKING -->
</fileSet>
<fileSet>
<directory>src/main/resources/logs/
</directory>
<outputDirectory>/logs/</outputDirectory>
<fileMode>0666</fileMode> <!-- NOT WORKING -->
</fileSet>
<fileSet>
<directory>src/main/resources/sh/</directory>
<outputDirectory>/sh/</outputDirectory>
<excludes>
<exclude>*.formatted</exclude>
</excludes>
<lineEnding>unix</lineEnding>
</fileSet>
</fileSets>
在excel/文件夹下解压的所有文件都具有-rw rw rw-permission,即0666。在logs/文件夹下解压的所有文件都有-rwxrwxr-x,而不是0666。
这是pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<id>assembly</id>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
暂无答案!
目前还没有任何答案,快来回答吧!