为什么 Hudson 不识别 xcopy 作为命令?
我的 hudson 构建步骤中有一个 Windows 批处理命令,基本上是:
xcopy /s *.* \\serverlocation\buildname\
复制失败:
'xcopy' is not recognized as an internal or external command, operable program or batch file.
但是,xcopy 可在命令行上使用(与复制一样)。 我需要做什么才能让 hudson 使用 xcopy?
编辑:我的路径
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Perforce;C:\Program Files\CVSNT;C:\Program Files\CVSNT\
可能就是它从命令行工作的原因。
I have a windows batch command in my hudson build step that is basically:
xcopy /s *.* \\serverlocation\buildname\
The copy is failing with:
'xcopy' is not recognized as an internal or external command, operable program or batch file.
However, xcopy is usable on the command line (as is copy). What do I need to do to make hudson use xcopy?
Edit: My path is
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Perforce;C:\Program Files\CVSNT;C:\Program Files\CVSNT\
which is probably why it works from the command line.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
xcopy
位于您的system32
目录中; 确保它位于您的PATH
中。xcopy
is in yoursystem32
directory; make sure that's in yourPATH
.当将 Xcopy 与 Hudson(或其他构建系统)一起使用时,您可能需要注意的是被复制文件的路径总长度。
就我而言,我遇到了使用 xcopy 复制埋藏在目录结构中多个级别的文件的问题,这样当与 Hudson 的工作/构建路径级别结合使用时,它(我假设)超出了最大允许路径长度供 xcopy 使用。 我当前的解决方法是在复制构建输出之前简单地对其进行压缩,但我正在寻找更干净的东西。
Something you may want to watch out for when using Xcopy with Hudson (or other build systems really) is the total length of the path of the file being copied.
In my case, I'm running into issues using xcopy to copy files that are buried many levels down in a directory structure such that when combined with Hudson's working/build path level, it (I'm assuming) exceeds the maximum allowable path length for xcopy to work with. My current work-around is to simply zip build output before copying it, but I'm looking for something a little cleaner.