svnAnt任务ubuntu失败,无法找到javahl,svnkit和命令行svn客户端

时间:2012-11-20 16:22:33

标签: svn ubuntu ant svnant

这些问题有同样的问题,但没有为我提供解决方案

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

Cannot find javahl, svnkit nor command line svn client

我正在使用

ubuntu 12.10

ant 1.8.2

svnAnt 1.3.1

svn version 1.6

我使用apt-get install

下载

svnclient

libsvn-java的

我已经设置了

JAVA_HOME

ANT_HOME

我在路径中添加了ANT_HOME / bin 我还将/ usr / lib / x86_64-linux-gnu / jni /添加到路径中,这似乎不是这些库使用/通常的位置。

如果我从命令行运行ant,则失败并显示:

$ 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

如果我将javahl="false" svnkit="true"属性添加到svn标记,则

会失败
$ 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

如果我将用户名和密码添加到它失败的任务中(我通常使用svn + ssh和公共私钥认证):

$ 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

1 个答案:

答案 0 :(得分:0)

您确实安装了命令行客户端svnclient),但您没有告诉 Ant 使用它:

javahl="false" svnkit="false"

需要将都设置为false才能使用命令行客户端。来自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
相关问题