Subversion Ant 更新任务永远无法完成
我已经从 tigris.org 下载了 ant 的 svntask,所以它是“官方”的。
我有一个简单的任务来更新我的整个项目
<target name="prepare">
<svn username="user" password="pass">
<update>
<fileset dir="."/>
</update>
</svn>
</target>
运行此任务大约需要 2 小时。
在命令行上运行 svn update 大约需要 5 秒。
(在这两种情况下,都没有从服务器上下载更新)
我还尝试更改 svntask 用于与 subversion 交互的方法,我尝试了 svnkit 方法和命令行方法。
有什么想法为什么这可能需要这么长时间吗? 显然,这是令人无法接受的慢。
谢谢
I've downloaded the svntask for ant from tigris.org, so it is the "official" one.
I have a simple task to update my entire project
<target name="prepare">
<svn username="user" password="pass">
<update>
<fileset dir="."/>
</update>
</svn>
</target>
Running this task took about 2 hours.
Running a svn update
on the command line took about 5 seconds.
(in both cases, there were no updates to bring down from the server)
I've also tried chaning the method that svntask uses to interface with subversion, I've tried both the svnkit method and the command line method.
Any ideas why this may be taking so long? Obviously this is unacceptably slow.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
通过使用嵌套的
,该命令最终会为当前目录层次结构中的每个文件调用update
。 这可能就是为什么需要两个小时的原因。尝试使用
update
任务的dir
属性:如果这不起作用,请打开
-verbose
或-debug
并查看您是否可以获得有关任务期间发生的情况的更多信息。By using the nested
<fileset>
the command ends up callingupdate
for every file in the current directory hierarchy. That's probably why it takes two hours.Try using the
dir
attribute of theupdate
task:And, if that doesn't work, turn on
-verbose
or-debug
and see if you can get more information about what is happening during the task.1.您使用哪个库来访问svn(svnkit或javahl)?
尝试明确提供适当的库:
2.我不确定您是否必须提供更新的用户名和密码参数(它们在结账时被缓存)。
3.如果您的用例与我的类似,您可以对结帐和更新重复使用结帐任务:
1.Which lib are you using for accessing to svn (svnkit or javahl)?
Try to explicitly provide an appropriate library:
2.I'm not sure if you have to provide username and password params for an update (their were cached on checkout).
3.If your use case are similar to mine, you can reuse checkout task for both checkout and an update:
那么如果你只运行“antprepare”需要2小时? 或者这 2 小时的持续时间仅在特殊条件下(例如您的构建机器)?
您是否尝试过使用该任务进行比较,以尝试隔离它是否是 Ant 与特定任务?
So if you just run "ant prepare" it takes 2 hrs? Or is this 2 hr duration only under special conditions like your build machine?
Have you tried using the task for comparison, to try and isolate if it is Ant vs. the particular task?
我不明白为什么 svntask 需要 2 个小时,所以我首先更详细地研究一下这个问题。
但如果你必须的话,你可以从命令行运行 SVN:
编辑:实际上,你不需要 dos 窗口,你可以直接执行。 我这样做只是为了可以在 ant 控制台中看到输出。
I can't see why it would take 2 hours for the svntask, so I would first look into this in more details.
But if you must, you could run SVN from the command line:
Edit: Actually, you don't need the dos window, you can do it directly. I just do this so I can see the output in the ant console.
分析您的构建以了解它实际花费大部分时间的地方可能会很有启发。 antutility 非常容易用于此目的。 只需将 jar 添加到您的类路径并运行它,如下所示:
It might be instructive to profile your build to see where it's actually spending most of its time. antutility is very easy to use for this purpose. Just add the jar to your classpath and run it like: