Ant exec 不执行 Hudson 中的命令
当我在 Windows XP 中从命令行运行以下代码片段时,Ant 目标会按我的预期执行。然而,当我从 Hudson (v1.398) 运行它时,它说脚本完成得很好,但它实际上没有做任何事情。它根本不运行 AdminShellExec.exe。我做错了什么?我也在 ant 脚本中尝试了几种不同的方法(没有 .txt 文件,首先执行 cmd.exe /C,使用 arg 行而不是重定向器,等等),但有同样的问题。
<target name="stop-model">
<echo file="Script.txt">STOP model1 Force exit</echo>
<exec executable="AdminShellExec.exe">
<redirector input="Script.txt"></redirector>
</exec>
</target>
When I just run the snippet of the following from the command line in Windows XP, the Ant target executes as I expect. However, when I run it from Hudson (v1.398) it says the script completes fine, but it doesn't actually do anything. It does not run the AdminShellExec.exe at all. What am I doing wrong? I have tried this several different ways in the ant script too (without .txt file, do cmd.exe /C first, use arg line instead of redirector, etc...), but same issue.
<target name="stop-model">
<echo file="Script.txt">STOP model1 Force exit</echo>
<exec executable="AdminShellExec.exe">
<redirector input="Script.txt"></redirector>
</exec>
</target>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来您的文件路径可能有问题。尝试指定所有文件的完整路径。
例如
c:\myfolder\AdminShellExec.exe
c:\myfolder\Script.txt
Looks like you might have issues with the file paths. Try specifying the full path to all files.
e.g.
c:\myfolder\AdminShellExec.exe
c:\myfolder\Script.txt
您可能想在构建文件中设置 basedir 属性
http://ant.apache.org/manual/using.html
You might want to set the basedir attribute in your build file
http://ant.apache.org/manual/using.html