i mam使用maven-semembly-plugin创建包含一些文物和其他内容的zip文件。附加的东西位于一个名为" installationAttachments"的文件夹中。到目前为止的一切都很好。" installationAttachments"还包含一个PNG和一个ICO文件,其中还包含这些文件,但其中包括在其中包含这些文件。这是我的pom.xml的插件声明:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/dep.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>create-archive</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<inherited>false</inherited>
</plugin>
这就是大会本身的关键部分:
<!-- installation files -->
<fileSet>
<directory>Installationattachments</directory>
<outputDirectory></outputDirectory>
<lineEnding>unix</lineEnding>
<excludes>
<exclude>*.vbs</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>Installationattachments</directory>
<outputDirectory></outputDirectory>
<lineEnding>dos</lineEnding>
<includes>
<include>*.vbs</include>
</includes>
</fileSet>
问题是通过<lineEnding>
参数的行末端规范。第一个文件集选择所有不是VBS文件的文件,因此它还选择PNG和ICO文件。但是由于这些是二进制文件,因此您不想为这些文件设置特定的线路。
由于缺乏nonFilteredFileExtensions
(在Massembly-849中询问其支持),您可以添加第三个文件集而无需线结束的图像:
<fileSet>
<directory>Installationattachments</directory>
<outputDirectory></outputDirectory>
<lineEnding>unix</lineEnding>
<excludes>
<exclude>*.vbs</exclude>
<exclude>*.ico</exclude>
<exclude>*.png</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>Installationattachments</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.ico</include>
<include>*.png</include>
</includes>
</fileSet>
<fileSet>
<directory>Installationattachments</directory>
<outputDirectory></outputDirectory>
<lineEnding>dos</lineEnding>
<includes>
<include>*.vbs</include>
</includes>
</fileSet>