ANT 结帐任务失败 [英] ANT checkout task fails

查看:37
本文介绍了ANT 结帐任务失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下标记:

<?xml version="1.0" ?>
<project name="SampleBuild" default="compile" basedir=".">
    <property name="SvnAntDir" value="C:/Program Files/Apache/svnant-1.2.1/doc" />  
    <property name="src" value="_src_" />
    <property name="build" value="_build_"/>
    <property name="dist" value="${build}/_jars_" />    

    <path id= "svnant.classpath" >
        <fileset dir= "${SvnAntDir}" >
            <include name= "*.jar" />
        </fileset>
    </path>

    <target name="pre-cleanup">
        <delete dir="${src}" />     
        <delete file="${dist}/Project.jar" />
        <delete includeEmptyDirs="true" failonerror="false">
            <fileset dir="${build}/_classes_/sevgok/" />
        </delete>

        <mkdir dir="${src}" />
        <tstamp />
    </target>

    <target name="checkout" depends="pre-cleanup">      
        <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />       
        <svn>
            <checkout url="svn://p-subversion/Project/trunk" revision="HEAD" destPath="${src}" />
        </svn>
    </target>   

    <target name="compile" depends="checkout">
        <javac srcdir="${src}" destdir="${build}/_classes_" debug="on" debuglevel="lines,vars,source">
            <classpath>
                <pathelement path="${classpath}" />
                <fileset dir="./_libs_">
                    <include name="*.jar" />
                    <include name="*.zip" />
                </fileset>
            </classpath>
        </javac>
    </target>   
</project>

尝试进行构建时出现问题.错误消息是下一个:

Problem occurs when trying to make a build. The error message is next:

checkout: [svn] <Checkout> started ...
[svn] svn: svn://p-subversion/Project/trunk` doesn't exist
[svn] svn: svn://p-subversion/Project/trunk` doesn't exist
[svn] <Checkout> failed!

Build FAILED
C:\build.minimal.xml: (line of code which points to <svn> openning tag): Can't checkout.`

同时可以使用 url 与 Tortoise SVN 客户端进行结账.

Simultaneously it is possible to make a checkout with Tortoise SVN client using the url.

帮助!

编辑

我在构建时尝试使用 -v 键并得到以下结果:

I tried using -v key when building and got the following:

引起:org.tigris.subversion.svnclientadapter.SVNClientException:org.tigris.subversion.javahl.ClientException: svn: URL 'svn://p-subversion/Project/trunk' 不存在

编辑

有没有 SvnAnt 的替代品?如果它也有很好的文档记录,那就太好了.

Is there any alternative to SvnAnt? It would be great if it was also well documentated.

谢谢

编辑

所以对我有用的代码是:

So code that works for me is:

<target name="checkout" depends="pre-cleanup">
    <exec dir="${basedir}" executable="svn" failonerror="true">
        <arg line="checkout -r ${revision} ${SvnUrl} ${src}" />
    </exec>
</target>

其中 ${SvnUrl} 与我之前使用的 URL 相同.

where ${SvnUrl} is the same URL I used before.

推荐答案

如果 svnant 根本不起作用,您可以从命令行执行 svn:

If svnant does not work at all you could just execute svn from the command line:

<exec executable="svn" dir="DIRECTORY_WHERE_COMMAND_EXECUTES">
  <arg line="checkout svn://p-subversion/Project/trunk $src"/>
</exec>

您必须安装 svn 命令行客户端.确保将客户端的 bin-Directory 添加到 PATH.
但请注意安装与您的乌龟客户端相同的客户端版本.如果它们不匹配,它们将使另一个无法访问工作副本.

You would have to install a svn command line client. Make sure, that you add the bin-Directory of the client to the PATH.
But take care to install the same client version as your tortoise client. If they mismatch they will make the working copy unaccessible for the other.

这篇关于ANT 结帐任务失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆