Kill processes with Jenkins pipeline
<p>I have Jenkins script that executes a Windows application and runs some tests agains it.</p>

<p>With a normal (non-pipeline) Jenkins script, all processes were nicely cleaned up after job completion. It is my understanding that this is done by <a href="https://wiki.jenkins-ci.org/display/JENKINS/ProcessTreeKiller" rel="nofollow noreferrer">ProcessTreeKiller</a>.</p>

<p>I try to convert the script to a pipeline script, which works fine, except now the processes are no longer killed.</p>

<p>From <a href="https://stackoverflow.com/questions/25402350/jenkins-kill-all-child-processes">this</a> question I see that BUILD_ID must be set in the processes. That is the case.</p>

<p>How do I get pipeline to kill the processes?</p>