Complete the code to add a post-build action that archives artifacts.
post {
always {
archiveArtifacts artifacts: '[1]'
}
}The pattern **/*.jar archives all JAR files from all folders after the build.
Complete the code to send an email notification after the build.
post {
failure {
mail to: '[1]', subject: 'Build Failed', body: 'Please check the build logs.'
}
}The email should be sent to the development team, so dev-team@example.com is the correct recipient.
Fix the error in the post-build action that triggers a downstream job.
post {
success {
build job: '[1]'
}
}The job name is case-sensitive and usually uses PascalCase like DeployApp.
Fill both blanks to add a post-build action that triggers only when the build is unstable and waits for completion.
post {
unstable {
build job: '[1]', wait: [2]
}
}The job RunTests is triggered, and wait: true makes Jenkins wait for the job to finish.
Fill all three blanks to archive logs only if the build is successful and notify the team.
post {
success {
archiveArtifacts artifacts: '[1]'
mail to: '[2]', subject: '[3]'
}
}Logs matching **/logs/*.log are archived. The dev team is notified with the subject Build Success Notification.