This Groovy script which runs as a separate job in Jenkins that cleans up the folders of a workspace after it is built. It can be integrated with any new or existing job(best used for Maven/gradle builds that occupy a lot of space in workspace folder and is not cleaned). For more detailed steps please visit Link.