13

I've done numerous svn / ant set-ups and but this time cann't figure out what's wrong.

Using Linux,

svn 1.6.6
ant 1.8.2
svnant 1.3.1

I've copied the svnant jar files into $ANT_HOME/lib

top@secret:~/apps/apache-ant-1.8.2/lib$ ls -l
-rw-r--r-- 1 root root  244831 2011-06-23 07:55 ganymed.jar
-rw-r--r-- 1 root root  948100 2011-06-23 07:55 jna.jar
-rw-r--r-- 1 root root   76383 2011-06-23 07:55 svnant.jar
-rw-r--r-- 1 root root  215757 2011-06-23 07:55 svnClientAdapter.jar
-rw-r--r-- 1 root root   89412 2011-06-23 07:55 svnjavahl.jar

etc...

My build file specifies:

<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask"   />

But whenever I execute

   <target name="update">
                <svn>
                        <update dir="."/>
                </svn>
        </target>

I get the dreaded:

update:
      [svn] Missing 'javahl' dependencies on the classpath !

BUILD FAILED
/home/top/apps/utils/build.xml:26: Cannot find javahl, svnkit nor command line svn client

Any ideas what I'm doing wrong?

I assumed copying the svnant jars into $ANT_HOME/lib should be enough?

Joel
  • 29,538
  • 35
  • 110
  • 138
  • this is a crosspost from http://serverfault.com/questions/283373/cannot-find-javahl-svnkit-nor-command-line-svn-client – oers Jun 23 '11 at 17:36
  • As of svnant 1.3.2 the attributes svnkit and javahl have been deprecated. The alternative is to use the svnSetting task. See my answer below. – prolink007 May 07 '12 at 15:39

3 Answers3

25

Javahl way always needs some kind of os-dependent driver. This is mostly hard to set-up and I don't recommend using it.

You should try using svnkit:

<svn svnkit="true">

This uses the pure java library, but needs svnkit.jar to be in the classpath.

References:

  1. http://subclipse.tigris.org/svnant/svn.html
  2. http://subclipse.tigris.org/wiki/JavaHL

I only use the fallback/commandline version, where the svn executable is in the PATH. This works in most cases without problems with the following settings:

<svn svnkit="false" javahl="false">

Note: These settings are for svnant 1.31 and prior. Since version 1.32 you can use <svnSetting />, which is described in the other answer

Community
  • 1
  • 1
oers
  • 18,436
  • 13
  • 66
  • 75
  • The strange thing is I've always done it as per my question before i.e. bung all the jars into $ANT_HOME/lib. I've no idea what's different this time. Maybe it's something to do with the fact that I'm using svn 1.6 instead of 1.5, and svnant 1.3 instead of 1.2 – Joel Jun 23 '11 at 17:48
  • It could be that the new version of svn ant behaves differently. I only vagueley remember the last struggle with it and I think I had similar problems. – oers Jun 23 '11 at 19:33
  • As of svnant 1.3.2 the attributes svnkit and javahl have been deprecated. The alternative is to use the svnSetting task. See my answer below. – prolink007 May 07 '12 at 15:39
  • Funny thing is that the 1.3.2 Version of SVN-ANT is not available for download. I suggest using jars from latest SVNkit to get this to work. – dARKpRINCE Mar 29 '16 at 13:22
15

As of svnant 1.3.2 the attributes svnkit and javahl have been deprecated. The alternative is to use the svnSetting task.

Put this task in your build file somewhere:

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

Then when you are calling the svn task use it this way (take note of the refid attribute):

<target name="doingSomethingAwesome">
    <svn refid="svn.settings">
        <!-- do something -->
    </svn>
</target>

Hope this helps, did me.

REFERENCE

prolink007
  • 33,872
  • 24
  • 117
  • 185
0

If you are getting "Cannot find javahl, svnkit nor command line svn client" then you have to make ensure that svn path have been set or not : for exa : path=c:\svn\bin;