Sometimes, Jenkins builds simply get stuck, and aborting them from the job page does not help.
If this is your case, then, you can do something with it:
- read your build job’s full name and, the build number that you wan to terminate
- run the following code from your Jenkin’s script console (located at http://jenkins_url/script):
Jenkins.instance.getItemByFullName("<job_full_name>").getBuildByNumber(<build_number>).finish(hudson.model.Result.ABORTED, new java.io.IOException("Stopping this build without being polite."));