如何使用 ANT 任务从 SVN 结帐? [英] How to checkout from SVN with an ANT task?
问题描述
我对任何方式感兴趣,我可以创建一个 Ant 任务来从 SubVersion 检出文件.我只是"想从命令行进行结帐.我已经使用 Eclipse 和 Ant 和 SubVersion 有一段时间了,但我的 Ant 和 SubVersion 知识有点缺乏,因为我依靠 Eclipse 将它们连接在一起.
I'm interested in any way that I can create an Ant task to checkout files from SubVersion. I "just" want to do the checkout from the command line. I've been using Eclipse with Ant and SubVersion for a while now, but my Ant and SubVersion knowledge is somewhat lacking as I relied on Eclipse to wire it all together.
我一直将 SvnAnt 视为一种解决方案,它是来自 Tigris 的 Subclipse 的一部分,位于 http://subclipse.tigris.org/svnant/svn.html.它可能工作正常,但我得到的只是 NoClassDefFoundErrors.对于更有经验的人来说,这可能看起来像一个简单的 Ant 配置问题,但我不知道.我将 svnant.jar 和 svnclientadapter.jar 复制到我的 Ant lib 目录中.然后我尝试运行以下命令:
I've been looking at SvnAnt as one solution, which is part of Subclipse from Tigris at http://subclipse.tigris.org/svnant/svn.html. It may work fine, but all I get are NoClassDefFoundErrors. To the more experienced this probably looks like a simple Ant configuration problem, but I don't know about that. I copied the svnant.jar and svnclientadapter.jar into my Ant lib directory. Then I tried to run the following:
<?xml version="1.0"?>
<project name="blah">
<property environment="env"/>
<path id="svnant.classpath">
<pathelement location="${env.ANT_HOME}/lib"/>
<fileset dir="${env.ANT_HOME}/lib/">
<include name="svnant.jar"/>
</fileset>
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
<target name="checkout">
<svn username="abc" password="123">
<checkout url="svn://blah/blah/trunk" destPath="workingcopy"/>
</svn>
</target>
</project>
我收到以下回复:
build.xml:17: java.lang.NoClassDefFoundError: org/tigris/subversion/javahl/SVNClientInterface
我在 32 位 Windows XP 上运行 SVN 1.7 和 SvnAnt 1.3.
I am running SVN 1.7 and SvnAnt 1.3 on Windows XP 32-bit.
感谢您的指点!
推荐答案
如果 SvnAnt 无法正常工作,您可以随时使用 exec:
If you don't get SvnAnt working, you can always use exec:
<exec executable="/usr/local/bin/svn">
<arg value="co" />
<arg value="svn://repository/url" />
<arg value="/destination/directory" />
</exec>
这篇关于如何使用 ANT 任务从 SVN 结帐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!