[英]Error while running pipeline shell script in jenkins
pipeline {
agent any
tools{
maven "maven"
}
stages{
stage('git scm'){
steps{
git changelog: false, poll: false, url:'https://github.com/saikishore789/SampleMaven.git'
}
}
stage('build'){
steps{
sh "mvn package"
}
}
}
}
After running this script build got failed and displaying this error:运行此脚本构建失败并显示此错误后:
Cannot run program "nohup" (in directory "C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Pipeline-project1"): CreateProcess error=2, The system cannot find the file specified
I assume you have a windows node, try to use this step bat
step instead of sh
:我假设您有一个 Windows 节点,请尝试使用此步骤bat
step 而不是sh
:
stage('build'){
steps{
bat "mvn package"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.