6

这就是我试图 scp 到远程机器的方式,我试图将整个目录复制到目标目录。

<target name="report-test-results" depends="run-junit-tests">
    <scp todir="root:somepassword@192.168.8.120:/home/hrishikesh/webui-test-results/">
            <fileset dir="${basedir}/test-results"/>
    </scp>
</target>

我收到以下错误:

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
4

3 回答 3

8

错误输出非常清楚地说明了如何解决此问题:

Action: Determine what extra JAR files are needed, and place them in one of:
    -ANT_HOME\lib
    -the IDE Ant configuration dialogs

在您的情况下,您缺少 jsch JAR 文件,该文件可以从JSch 站点下载。

于 2012-06-18T22:58:43.890 回答
4

签出任务的库依赖scp项。您需要包含jsch.jar在您的类路径中。

于 2012-06-18T22:58:38.840 回答
-2

在 Eclipse - Windows > Preferences > Ant > Classpath中添加JSch JAR 文件。

您可以从 Maven 中央存储库获取JAR 文件。

于 2014-11-28T18:22:58.007 回答