java 蚂蚁 scp 失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11092216/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ant scp failure
提问by riship89
This is how I am trying to scp to a remote machine, I am trying to copy whole directory to destination directory.
这就是我尝试 scp 到远程机器的方式,我试图将整个目录复制到目标目录。
<target name="report-test-results" depends="run-junit-tests">
<scp todir="root:[email protected]:/home/hrishikesh/webui-test-results/">
<fileset dir="${basedir}/test-results"/>
</scp>
</target>
I am getting following error:
我收到以下错误:
BUILD FAILED
C:\Users\hrishikesh\workspace\selenium4j\build.xml:122: Problem: failed to create task or type scp
Cause: Could not load a dependent class com/jcraft/jsch/Logger
It is not enough to have Ant's optional JARs
you need the JAR files that the optional tasks depend upon.
Ant's optional task dependencies are listed in the manual.
Action: Determine what extra JAR files are needed, and place them in one of:
-ANT_HOME\lib
-the IDE Ant configuration dialogs
Do not panic, this is a common problem.
The commonest cause is a missing JAR.
This is not a bug; it is a configuration problem
回答by gareth_bowles
The error output is pretty clear on how to fix this:
错误输出非常清楚如何解决这个问题:
Action: Determine what extra JAR files are needed, and place them in one of:
-ANT_HOME\lib
-the IDE Ant configuration dialogs
In your case you're missing the jsch JAR file, which can be downloaded from the JSch site.
在您的情况下,您缺少 jsch JAR 文件,该文件可以从JSch 站点下载。
回答by krock
Checkout the library dependanciesfor the scp
task. You need to include jsch.jar
in your classpath.