The svn client 'svnkit' is not available

前端 未结 1 1418
没有蜡笔的小新
没有蜡笔的小新 2020-12-12 02:43

I have been using svnant 1.3.0 to create tags from branches in my SVN repository. Now I have upgraded from SVN 1.6 to 1.7 and there is no released svnant binary that support

相关标签:
1条回答
  • 2020-12-12 03:10

    I would advise using the svnkit java classes directly instead of struggling with the svnant task. This approach, combined with a macrodef, will result in a similar but more reliable solution.

    <project name="build" default="checkout" xmlns:ivy="antlib:org.apache.ivy.ant">
    
        <!--
        ======
        Macros
        ======
        -->
        <macrodef name="svn-checkout">
            <attribute name="src"/>
            <attribute name="dest"/>
            <sequential>
                <mkdir dir="@{dest}"/>
                <java classname="org.tmatesoft.svn.cli.SVN" dir="@{dest}" fork="true" classpathref="build.path">
                    <arg value="--non-interactive"/>
                    <arg line="--username ${svn.user}"/>
                    <arg line="--password ${svn.pass}"/>
                    <arg value="checkout"/>
                    <arg value="@{src}"/>
                </java>
            </sequential>
        </macrodef>
    
        <!--
        =======
        Targets
        =======
        -->
        <target name="resolve" description="Resolve 3rd party dependencies">
            <ivy:cachepath pathid="build.path">
                <dependency org="org.tmatesoft.svnkit" name="svnkit-cli" rev="1.7.8" conf="default"/>
            </ivy:cachepath>
        </target>
    
        <target name="checkout" depends="resolve" description="Pull code from SCM repository">
            <svn-checkout src="http://svn.apache.org/repos/asf/subversion/trunk" dest="build/subversion"/>
        </target>
    
        <target name="clean" description="Cleanup build files">
            <delete dir="build"/>
        </target>
    
        <target name="clean-all" depends="clean" description="Cleanup and purge ivy cache">
            <ivy:cleancache/>
        </target>
    
    </project>
    

    Note:

    • This example uses the ivy cachepath task to download the dependencies into a local classpath reference called "build.path".
    0 讨论(0)
提交回复
热议问题