1

我利用 maven 程序集在 CentOS(LANG=ko_KR.UTF-8) 中压缩包含非 ascii 文件名的文件夹。

当我在 Windows 中打开 zip 文件时,文件名被分解为奇怪的字符。

它在 Linux 中看起来没问题。

我检查了在 linux 中通过命令行 zip 压缩的文件,在 Windows 中正确显示了名称。

我猜是插件部署的Java zip库产生了错误。

下面是 pom.xml 和程序集描述符的一部分。

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.build.timestamp.format>yyyy-MM-dd-HH:mm</maven.build.timestamp.format>
</properties>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                    <configuration>
                        <appendAssemblyId>false</appendAssemblyId>
                        <descriptors>
                            <descriptor>maven/assembly_descriptor.xml</descriptor>
                        </descriptors>
                    </configuration>
                </execution>
            </executions>
        </plugin>


<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
  <id>distribution</id>
  <formats>
    <format>zip</format>
  </formats>

  <fileSets>
    <fileSet>
      <directory>${project.basedir}</directory>
      <outputDirectory>/</outputDirectory>
      <includes>
        <include>README*</include>
        <include>LICENSE*</include>
        <include>NOTICE*</include>
      </includes>
    </fileSet>
4

0 回答 0