How to use the Jenkins Heavy Job Property with Pipeline Jobs
<p>I have a pipeline job that consists of several stages, each of which takes several hours. 
Before pipelining, each stage was its own job, and I was using the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Heavy+Job+Plugin" rel="nofollow noreferrer">Heavy Job Plugin</a> for some of them. Now it looks as though the "properties" command allows to specify the "HeavyJobProperty". I managed to get its syntax correctly thanks to <a href="https://stackoverflow.com/questions/35370810/how-do-i-use-jenkins-pipeline-properties-step">this question</a>.</p>

<p>My pipeline script looks likes this:</p>

<pre><code>node ('&lt;label&gt;') {
    ws ('&lt;mydir&gt;') {
        // Mark the code checkout 'stage'....
        stage 'Checkout'

        git url: '&lt;repourl&gt;'

        stage 'Build'
        properties ([[$class: 'HeavyJobProperty', weight: 8]])

        sh '&lt;mybuild&gt;'
    }
}
</code></pre>

<p>Unfortunately, this doesn't seem to work, when executing the script, I get the message:</p>

<blockquote>
  <p>ERROR: cannot apply hudson.plugins.heavy_job.HeavyJobProperty to a
  WorkflowJob</p>
</blockquote>

<p>Does anyone have an idea how I get this to work?</p>

<p><strong>It looks as though the plugin simply hasn't been adapted to pipelining jobs yet, even though the pipelining docs shows the HeavyJobProperty.</strong></p>