Issue
When building a Jenkins pipeline job (Jenkins ver. 2.7.4), I get this warning:
Using the ‘stage’ step without a block argument is deprecated
How do I fix it?
Pipeline script snippet:
stage 'Workspace Cleanup'
deleteDir()
Solution
From Jenkins pipeline stage step doc:
An older, deprecated mode of this step did not take a block argument...
In order to remove the warning just add a block argument:
stage('Stage Name') {
// some block
}
You can also generate a stage step using Snippet Generator.
Answered By - Boris
Answer Checked By - David Goodson (JavaFixing Volunteer)