Ant scp失败

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
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网站下载。

完全命中目标…它清楚地说不要惊慌,但我还是惊慌了。不管怎样,我的问题已经解决了,谢谢。也感谢krock的帮助。 - hrishikeshp19
2
在Debian上,只需安装libjsch-java软件包即可。 - user3132194

4

-2

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

你可以从Maven Central仓库获取 JAR 文件


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接