0

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

尽管我有命令行 svn,但找不到 javahl、svnkit 和命令行 svn 客户端

找不到 javahl、svnkit 和命令行 svn 客户端

我在用

Ubuntu 12.10

蚂蚁 1.8.2

svnAnt 1.3.1

svn 1.6 版

我使用 apt-get install 下载

svn客户端

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
4

1 回答 1

0

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

javahl="false" svnkit="false"

两者都需要设置为 false 才能使用命令行客户端。从参考

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
于 2012-11-22T22:05:36.473 回答