java 如何在构建前删除 Hudson 工作区?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/882782/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to delete Hudson workspace before build?
提问by Mauli
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?
我想有办法教 hudson 在结帐和构建之前删除整个工作区。有没有插件可以实现?
采纳答案by Michael Donohue
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
目前,每个 SCM 插件都提供工作区清理功能。很快,核心 Hudson 将拥有此功能,SCM 插件会将设置迁移到该核心功能: 问题 3966
回答by matt b
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.
在“源代码管理”下,展开高级属性并取消选中“使用更新”(此选项适用于 CVS,不确定所有其他 SCM 工具)。此选项控制 Hudson 是否使用“更新”命令简单地从 SCM 获取更改的文件,或者是否从源代码管理中检出新的/干净的副本。
回答by Edgar Kenji Tanaka
There is an option under Advanced Project Options: Clean workspace before build.
下有一个选项Advanced Project Options:构建前清理工作区。
It does exactly what you want.
它完全符合您的要求。
回答by MikeNereson
Uncheck Use Update under SCM options ANDuse call maven's clean phase in your command.
取消选中使用更新下SCM方案选择和你的命令使用电话Maven的清理阶段。
回答by Günter Z?chbauer
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
我还没有使用它们,但 AFAIK 有可用的 hudson-plugins 允许批处理脚本作为可能删除目录的构建前和构建后步骤运行。查看:管理 Hudson -> 管理插件 -> 可用
回答by CJBrew
The Subversion plugin for Hudson now has a switch to "Emulate Checkout" -- it removes unversioned files before reverting and updating.
Hudson 的 Subversion 插件现在可以切换到“Emulate Checkout”——它在恢复和更新之前删除未版本控制的文件。

