Jenkins doesn't execute shell scripts in case of build failure

hudson, jenkins

Solution

You should be able to achieve this with Any Build Step Plugin. Use it to run your script as post-build action.

As stated in Any Build Step Plugin page, it also seems to require Flexible Publish Plugin in order to allow running any build step as post-build action.

Problem

I have a build step in Jenkins job, which executes a shell script. When build failes, it is omitted. What can I do to avoid this and execute my script with any build state?

Original source