Jenkins中Git及log中文乱码问题

Posted zcube

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Jenkins中Git及log中文乱码问题相关的知识,希望对你有一定的参考价值。

解决方案:
1、在.jenkins/jenkins.xml中新增-Dfile.encoding=utf-8,可解决jenkins信息乱码问题,如下:
<arguments>-Xrs -Xmx256m -Dfile.encoding=utf-8 -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\\jenkins.war" --httpPort=8080</arguments>

2、在项目配置中,每个Execute Windows batch command中添加 chcp 65001 命令,比如:

chcp 65001 & chdir "%WORKSPACE%\\BinTest" & "%WORKSPACE%\\BinTest\\AutoRunTests.bat"


参考链接:
http://pcme.info/blog/2013/01/11/jenkins-git-changes-mojibake/
http://stackoverflow.com/questions/388490/unicode-characters-in-windows-command-line-how/388500#388500

以上是关于Jenkins中Git及log中文乱码问题的主要内容,如果未能解决你的问题,请参考以下文章

git- win10 cmd git log 中文乱码(方框)

jenkins使用git SCM时changelog乱码(Jenkins部署在Linux上,任务在Windows Slave上构建)

jenkins集群使用k8s部署,pipeline中文乱码的问题解决记录

Android git reflog 或 git log打印日志的乱码解决方案

git log 中文乱码问题(浪费了一天)

解决Git Log在IDEA中乱码的问题