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"
}
}
}
}
运行此脚本后,构建失败并显示此错误:
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
答案 0 :(得分:0)
我假设您有一个Windows节点,请尝试使用此步骤bat
代替sh
:
stage('build'){
steps{
bat "mvn package"
}
}