我有一个外部的Groovy脚本,需要通过Maven Assembly插件将其包含在zip文件中。我不能只是编译它,它必须以文本形式存在。我面临的问题是脚本包含一些特殊字符(如æ、ø、å),这导致了一些问题。脚本本身从Maven项目中的位置运行良好,但当我使用Maven Assembly插件打包并解压缩时,它的非ASCII字符会受到破坏。如果我使用7zip之类的软件来压缩和解压缩它,则脚本也可以正常运行而不会出现损坏。我该如何告诉Maven Assembly插件保留我的特殊字符呢?我真的很不想为了将其转换为Maven项目而修改大量代码。以下是我的pom文件的一部分:
我的描述器
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<encoding>UTF-8</encoding>
<descriptors>
<descriptor>src/main/assembly/archive.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
我的描述器
<id>archive</id>
<baseDirectory>/</baseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
...
<fileSet>
<lineEnding>unix</lineEnding>
<directory>src/main/groovy</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>BusinessServiceMock.groovy</include>
</includes>
</fileSet>
...