Jenkins Maven 编码和语言

huangapple go评论80阅读模式
英文:

Jenkins Maven encoding and languages

问题

我在JENKINS和MAVEN方面遇到了编码问题。
我正在进行测试,其中一个测试是将语言更改为本地语言(罗马尼亚语)。

如果我在pom.xml中使用UTF-8,编译时会出现“无法映射的字符”错误,我已将编码更改为“cp1252”,这种编码不会给我带来错误,但它也找不到使用本地语言的元素,我得到的是ROM?‚NÄ‚,而不是ROMÂNĂ。

是否有任何方法可以解决这个涉及多种编码的问题?

英文:

I have issue with JENKINS and MAVEN regarding encoding.
I am doing tests and one of the tests is changing language to domestic language (Romanian)

If I use UTF-8 in pom.xml I get "unmappable character" error when compiling, I have changed encoding to "cp1252", this encoding doesn't give me that error but it also doesn't find the elements that are using domestic language, I get ROM?‚NÄ‚ instead of ROMÂNĂ.

Is there any way to resolve this issue with multiple encoding?

答案1

得分: 1

The unmappable character error indicates a mismatch between the character encodings of input files and the Maven tooling.

Did you set the encoding using this property? This ensures that all plugins will use UTF-8.

<project>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
...

Also ensure that your source files are actually UTF-8. For more tips, see this link.

英文:

The unmappable character error indicates a mismatch between Character encodings of input files and the Maven tooling.

Did you set the encoding using this property? This ensures that all plugins will use UTF-8.

&lt;project&gt;
    &lt;properties&gt;
        &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
...

Also ensure that your source files are actually UTF-8. For more tips, see https://stackoverflow.com/a/8979120/8092868

huangapple
  • 本文由 发表于 2020年8月24日 17:44:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/63558489.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定