svnAnt task ubuntu fails with cannot find javahl, svnkit nor command line svn client

StackOverflow https://stackoverflow.com/questions/13477506

  •  30-11-2021
  •  | 
  •  

Question

These questions have the same issue but haven't provided a solution for me

Cannot find javahl, svnkit nor command line svn client although I have command line svn

Cannot find javahl, svnkit nor command line svn client

I am using

ubuntu 12.10

ant 1.8.2

svnAnt 1.3.1

svn version 1.6

I downloaded using apt-get install

svnclient

libsvn-java

I have set

JAVA_HOME

ANT_HOME

I added ANT_HOME/bin to the path I also added /usr/lib/x86_64-linux-gnu/jni/ to the path, this doesn’t seem to be where these libs used/normally are.

if I run ant from command line it fails with:

$ ant compile 
Buildfile: /home/build.xml

init:

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

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

Total time: 0 seconds

if I add javahl="false" svnkit="true" attributes to the svn tag it fails with

$ ant compile
Buildfile: /home/build.xml

init:

export:
  [svn] Deprecated attribute 'javahl'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.
  [svn] Deprecated attribute 'svnkit'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.
  [svn] svn: authentication cancelled
  [svn] svn: authentication cancelled
  [svn] <Export> failed.

BUILD FAILED
/home/build.xml:28:     Can't export

Total time: 0 seconds

If I add username and password to the task it fails with (I am using svn+ssh and public private key authentication normally):

$ ant compile
Buildfile: /home/build.xml
username:>
password:>

init:

export:
  [svn] Deprecated attribute 'javahl'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.
  [svn] Deprecated attribute 'svnkit'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.
  [svn] Deprecated attribute 'username'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.
  [svn] Deprecated attribute 'password'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.

BUILD FAILED
/home/build.xml:34: java.lang.NoClassDefFoundError: com/trilead/ssh2/ServerHostKeyVerifier
at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:89)
at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:74)
at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1242)
at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:168)
at org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:482)
at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:876)
at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:534)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doExport(SVNUpdateClient.java:1038)
at org.tmatesoft.svn.core.javahl.SVNClientImpl.doExport(SVNClientImpl.java:898)
at org.tmatesoft.svn.core.javahl.SVNClientImpl.doExport(SVNClientImpl.java:889)
at org.tmatesoft.svn.core.javahl.SVNClientImpl.doExport(SVNClientImpl.java:885)
at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.doExport(AbstractJhlClientAdapter.java:897)
at org.tigris.subversion.svnant.commands.Export.execute(Unknown Source)
at org.tigris.subversion.svnant.commands.SvnCommand.executeCommand(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)
Caused by: java.lang.ClassNotFoundException: com.trilead.ssh2.ServerHostKeyVerifier
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 33 more

Total time: 18 seconds
Était-ce utile?

La solution

You did install the command line client (svnclient), but you did not tell Ant to use it:

javahl="false" svnkit="false"

Both need to be set to false to use the command line client. From the reference:

javahl  Set to "false" to use command line client interface instead of JNI JavaHL binding.
        Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.
        Default: true

svnkit  Set to "false" to use command line client interface instead of SVNKit binding.
        Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.
        Default: false
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top