I am looking for a way to run a java process in background using Jenkins declarative pipeline. Below is the snippet of code
stage('Deploy'){
steps{
script{
withEnv(['BUILD_ID=dontkill']) {
sh "nohup java -jar test-0.0.1-SNAPSHOT.war &"
}
}
}
}
Already aware of ProcessTreeKiller of Jenkins and every answer suggest to do the same. I have tried using environment inside the steps block with no luck.
Jenkins version : 2.60.1
Pipeline plugin : 1.1.7
Any help is greatly appreciated.
/tmp
for example), and run everything between the double-quotes.