missing svnkit dependencies on the classpath using svnant

prolink007 picture prolink007 · May 23, 2012 · Viewed 13.1k times · Source

I am trying to get svnkit working with svnant.

Here is my build file:

<path id="svnant.classpath">
    <pathelement location="${env.ANT}/../lib/svnant.jar"/>
    <pathelement location="${env.ANT}/../lib/svnClientAdapter.jar"/>
    <pathelement location="${env.ANT}/../lib/svnkit.jar"/>
    <pathelement location="${env.ANT}/../lib/ganymed.jar"/>
</path>

    <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" /> 

    <svnSetting
        svnkit="true"
        javahl="false"
        id="svn.settings"/>

    <target 
        name="svnTest">
        <svn refid="svn.settings">
            <wcversion
                path="${basedir}\..\"
                prefix="svn."
            />

            <info 
                target="${basedir}\..\"
                propPrefix="svn.info."/>
        </svn>
    </target>

When running this buildfile i get the following error. svnkit.jar and ganymed.jar is in my ant/lib directory and so are the other stuff i included in the classpath. What am i doing wrong?

svnTest:
      [svn] Missing 'svnkit' dependencies on the classpath !

BUILD FAILED
build.xml:53: Cannot find javahl, svnkit nor command line svn client

Verbose error:

repoCheckDev:
      [svn] Missing 'svnkit' dependencies on the classpath !

BUILD FAILED
build.xml:line#: Cannot find javahl, svnkit nor command line svn client
        at org.tigris.subversion.svnant.SvnFacade.getClientAdapter(Unknown Source)
        at org.tigris.subversion.svnant.SvnTask.executeImpl(Unknown Source)
        at org.tigris.subversion.svnant.SvnTask.execute(Unknown Source)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Answer

oers picture oers · May 23, 2012

You are be missing the ganymed.jar and javahl.jar which are required for svnkit. This information is from the guide:

svnkit

The svnkit binding is purely java based. Using this binding requires the jar svnkit.jar to be used for the svnant declaration. You also need the ganymed.jar which provides the necessary functionality for SSH based communication.

ganymed.jar is part of the svnant download or can be downloaded here

Configuring svnant via classpath and taskdef

This is is a correct und functioning version of the classpath, all libs are in an svnlib folder which is relative to

  <path id="svnant.classpath">
      <pathelement location="svnlib/svnant.jar"/>
      <pathelement location="svnlib/svnClientAdapter.jar"/>
      <pathelement location="svnlib/svnkit.jar"/>
      <pathelement location="svnlib/ganymed.jar"/>
      <pathelement location="svnlib/svnjavahl.jar"/>
  </path>

All libs in ANT_HOME/lib

If you have all then required libs in ANT_HOME/lib you can simply use the following:

<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" />