Clean Hudson Workspace Before Build

In order to clean/delete the workspace before the build, “Add Build Step”, select “Execute Shell”, and use Hudson $WORKSPACE variable to delete the target directory:

rm -rf $WORKSPACE/target/*

Here is what it will look like:

clean hudson workspace before build

built-in support is on the way: HUDSON-3966

One comment

  1. This is only a solution if you\’re not using SCM, CVS, SVN, ClearCase etc happens prior to any build steps. by \’rm -rf\’ you will remove the files that have just been checked out.

tell me something...
  1. (required)
  2. (valid email - optional)
  3. Captcha
  4. (required)