I want to have a way to teach hudson to delete the complete workspace before doing a checkout & build. Is there a plugin which enables that?
Under Source Code Management, expand the advanced properties and un-check "Use Update" (this option is present for me for CVS, not sure about all other SCM tools). This option controls if Hudson uses an "update" command to simply grab changed files from SCM, or if it checks out a new/clean copy from source control.
Uncheck Use Update under SCM options AND use call maven's clean phase in your command.
Currently, each SCM plugin provides workspace cleanup functionality. Soon, core Hudson will have this capability, and the SCM plugins will migrate the setting to that core feature: issue 3966
OK, now can I tell Hudson to clean the workspace immediately AFTER the build is complete? Not before the actual build, like unchecking the "Update" box does...
I haven't used them yet, but AFAIK there are hudson-plugins available which allow batch scripts to run as pre- and post-build steps which could delete the directory. Check out: Manage Hudson -> Manage Plugins -> Available