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

查看:221
本文介绍了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做出与乌龟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-颠覆/项目/主干
不存在

修改

有没有替代SvnAnt?这将是巨大的,如果它也很好documentated。

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

感谢

修改

所以,code,对我的工作原理是:

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命令行客户端。确保,您添加 -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天全站免登陆