5

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)
prolink007
  • 33,872
  • 24
  • 117
  • 185

1 Answers1

5

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" /> 
oers
  • 18,436
  • 13
  • 66
  • 75
  • I added `ganymed.jar` to the ant/lib folder and it still did not work. Also, added `ganymed.jar` to see if that worked and it still did not work. – prolink007 May 23 '12 at 14:10
  • Yeah, that is what i meant by "Also, added ganymed.jar to see if that worked and it still did not work." But i failed to say it correctly in my comment. – prolink007 May 23 '12 at 14:18
  • If i have them in my `ant/lib` directory do i need them on my classpath? I will try this with verbose mode activated and give you results soon. – prolink007 May 23 '12 at 14:26
  • Added verbose output to my op and changed the op to reflect my changes i have made. – prolink007 May 23 '12 at 14:34
  • 1
    I did the **Using svnant as an antlib** and it did not work. `Problem: failed to create task or type svnSetting`. I copied all the jars out of the `svnant/lib` into my `ant/lib` directory. – prolink007 May 23 '12 at 14:47
  • `Problem: failed to create task or type svnantlib:org.tigris.subversion.svnant/:svnSetting` Still not working. – prolink007 May 23 '12 at 15:04
  • @prolink007 i found the problem, javahl.jar was missing, I tested it personally today :) I'll remove all my comments from this post, to reduce the chats :) – oers May 24 '12 at 06:56
  • I have `svnjavahl.jar` in my `ant/lib/` directory. And i set `javahl="true"` and it still gave me the same error `Problem: failed to create task or type svnantlib:org.tigris.subversion.svnant/:svnSetting`. – prolink007 May 24 '12 at 16:39
  • @prolink007 please try it with the classpath and the separate folder for the libs and javahl=false, this worked defintely for me – oers May 24 '12 at 17:23
  • @prolink007 and i used the 1.31 one version. I simply took your buildscript, added the javahl.jar to the classpath and it worked. – oers May 24 '12 at 17:30
  • It is now "working". However, i am getting another issue: `the path appears to be part of a subversion 1.7 or greater working copy please upgrade your subversion client to this` My tortoise client and subversion are 1.7.1. I do not want to downgrade, is there any way to get this to work without downgrading? – prolink007 May 24 '12 at 19:31
  • @prolink007 unfortunately that is not possible, every svn tool has to use the same svn version to make sure that everything works fine. Thats painful but there is no way around :/ – oers May 24 '12 at 19:53
  • uhg. Thanks for all the help. Wish i could +++++. =) – prolink007 May 24 '12 at 20:19