jenkins - i am getting [0m[[0m[0minfo[0m] [0m[0m in jenkins console on building sbt jenkins pipeline project
问题描述
i have an sbt project in jenkins, created the project as jenkins pipeline project, i have installed sbt in jenkins, i have checked the auto install checkbox and select the version number 1.2.8
here is my jenkins file
pipeline {
agent any
stages {
stage('Reload') {
steps {
echo "Reloading..."
//sh "sbt reload"
sh "${tool name: 'sbt1.2.8', type: 'org.jvnet.hudson.plugins.SbtPluginBuilder$SbtInstallation'}/bin/sbt compile"
}
}
}
}
and here is sbt settings in jenkins
here is jenkins console logs
+ /var/lib/jenkins/tools/org.jvnet.hudson.plugins.SbtPluginBuilder_SbtInstallation/sbt1.2.8/bin/sbt compile
[0m[[0m[0minfo[0m] [0m[0mLoading settings for project interpret-backend-project-jenkinsfile-build from plugins.sbt ...[0m
[0m[[0m[0minfo[0m] [0m[0mLoading project definition from /var/lib/jenkins/workspace/interpret-backend-project-jenkinsfile/project[0m
[0m[[0m[0minfo[0m] [0m[0mLoading settings for project interpret-backend-project-jenkinsfile from build.sbt ...[0m
[0m[[0m[0minfo[0m] [0m[0mSet current project to interpret (in build file:/var/lib/jenkins/workspace/interpret-backend-project-jenkinsfile/)[0m
[0m[[0m[0minfo[0m] [0m[0mExecuting in batch mode. For better performance use sbt's shell[0m
[0m[[0m[32msuccess[0m] [0m[0mTotal time: 4 s, completed Nov 25, 2020, 4:53:05 PM[0m
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
[Checks API] No suitable checks publisher found.
Finished: SUCCESS
[0m[[0m[0minfo[0m] [0m[0m why is this displaying how can i fix this ?
解决方案
这些是 ANSI 颜色代码。您可以拥抱它们以获得彩色日志或禁用它们。
要在 Jenkins 中启用颜色,您可以修改管道定义:
pipeline {
...
options {
ansiColor('xterm')
}
...
}
这是对AnsiColor插件的引用。
如果你不能使用这个插件并且想在 sbt 日志中禁用颜色,你可以通过修改sbt.color
选项来做到这一点。例如,通过启动 sbt -Dsbt.color=false
(我看到您可以在 UI 中添加它)或将其添加到SBT_OPTS
环境变量中:
pipeline{
...
environment {
SBT_OPTS = "${SBT_OPTS} -Dsbt.color=false"
}
...
}
查看sbt 文档并查看该sbt.ci
选项,它应该在 Jenkins 上自动设置。
推荐阅读
- android - Android按钮点击事件的Kotlin协程流程示例?
- javascript - 在不滚动的元素上使用 onscroll
- selenium - 如何在包含标签内设置功能文件的优先级
- angular - Angular 的可重用组件
- anaconda - SIFT、SURF 等特征描述符不适用于基本的 python 3.7 和 anaconda python 3.6.5
- javascript - jQuery .text() 没有显示表情符号
- spring-integration - 如何在将文件发送到 sftp 出站适配器之前检查文件计数
- aws-lambda - 来自网络浏览器的 Alexa 技能(内在功能)
- php - 编写代码生成所有数对,其平方和等于 100
- javascript - 使用谷歌应用脚本登录网站时出现错误 404