I will briefly explain the issue:
I am executing a gradle task through Hudson. The gradle task executes some groovy code. If I cancel the Hudson job, executing the gradle task, then the gradle task ends abruptly, without completely executing the groovy code inside it.
Is there a way, where even though the gradle task terminates abruptly, a block of code will defiantly execute? This is to handle graceful exit. Like in java we have a finally block.
Any help with this will be highly appreciated.