简体   繁体   English

使用 Jenkins 构建耳朵时属性文件中的编码问题

[英]Encoding issue in property file when the ear is built using Jenkins

My project uses 2 property file based on the locale message.properties and message_de.properties.我的项目使用 2 个基于语言环境 message.properties 和 message_de.properties 的属性文件。 The German property file contains umlaut.德语属性文件包含变音符号。 The issue is that when I use Jenkins to deploy the ear in JBoss server, the message_de.properties is not encoded properly.问题是当我使用 Jenkins 在 JBoss 服务器中部署耳朵时,message_de.properties 编码不正确。 But when I manually generate an ear in Windows and then copy to the server(linux machine), this issue is not found.但是当我在 Windows 中手动生成一个耳朵然后复制到服务器(linux机器)时,没有发现这个问题。 Please note I have used ISO-8859-1 for encoding.请注意,我使用 ISO-8859-1 进行编码。

The encoding issue of umlauts was occurring when the code was deployed through Jenkins.当通过 Jenkins 部署代码时,会出现变音符号的编码问题。 I have resolved it by setting the below value in Jenkins environment property JAVA_TOOL_OPTIONS=-Dfile.encoding=ISO-8859-1我已经通过在 Jenkins 环境属性 JAVA_TOOL_OPTIONS=-Dfile.encoding=ISO-8859-1 中设置以下值来解决它

The following link gives an example on how to set the environment property in Jenkins https://www.linkedin.com/pulse/how-resolve-utf-8-encoding-issue-jenkins-ajuram-salim以下链接给出了如何在 Jenkins https://www.linkedin.com/pulse/how-resolve-utf-8-encoding-issue-jenkins-ajuram-salim中设置环境属性的示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM