“ mvn clean”阶段卡住了一段时间,并导致以下错误:
[Pipeline] sh
process apparently never started in /home/jenkins/jenkins/workspace/<MyProject>@tmp/durable-8e4de4ec
(running Jenkins temporarily with -D
org.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem
clearer)
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE
这是我的jenkinsfile脚本:
pipeline{
agent{
label 'DOCKER'
}
tools {
maven 'M3'
jdk 'JAVA_HOME'
}
stages{
stage('build'){
steps{
echo 'Running Build Phase'
sh 'mvn clean'
}
}
}
}
不确定是否需要更新任何配置。我已经使用更新的open-jdk版本更新了/etc/init.d/jenkins。
答案 0 :(得分:3)
我遇到了同样的问题,发现如果您转到Manage Jenkins-> Configure System,则“全局属性”部分将有一个空的环境变量。只需删除该变量即可解决问题。
答案 1 :(得分:0)
结合 jenkins kubernetes-plugin,它可能是 Pipeline sh step hangs when multiple containers are used
部分中描述的 here (Kubernetes plugin for Jenkins) 问题。