【发布时间】:2010-11-19 13:05:47
【问题描述】:
如何指定(或“强制”)maven jar 插件以使用我的特定编码 (UTF-8)?
我的构建插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<phase>package</phase>
<id>configurations-test</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>target/test</classesDirectory>
<forceCreation>true</forceCreation>
<finalName>${artifactId}-test</finalName>
</excludes>
</configuration>
</execution>
</executions></plugin>
我在父 pom 中设置了编码,每个副本都使用正确的编码执行
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
我在创建 Jar 之前控制了文件,这些文件格式正确。
注意,我做了很多尝试将特定编码添加到配置中,但仍然无法正常工作,在我打包的 Jars 中,我发现了格式不正确的字符(如 é,应该是 é)
解压后的文件(html、xml、属性等)包含诸如 é 而不是 é 之类的字符。
【问题讨论】:
-
你是什么意思,你在你的罐子里找到了字符?在您的 jar 中的哪种文件中?一类? XML?财产? jar 文件的文件名?
-
当我解压结果 jar 文件时,文件格式不正确。
-
解压后的文件(html、xml、属性等)包含像é这样的字符而不是é
标签: plugins encoding utf-8 jar maven