2012-06-18 37 views
6

Đây là cách tôi đang cố gắng để scp đến một máy từ xa, tôi đang cố gắng để sao chép toàn bộ thư mục vào thư mục đích.lỗi ant 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> 

Tôi nhận được lỗi sau:

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 

Trả lời

7

Sản lượng lỗi là khá rõ ràng về cách để sửa lỗi này:

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

Trong trường hợp của bạn, bạn đang bỏ lỡ các tập tin JAR jsch, có thể được tải về từ JSch site.

+0

đập vào mục tiêu ... nó rõ ràng nói không hoảng sợ nhưng tôi đã làm. Dù sao, vấn đề của tôi được giải quyết, cảm ơn. Nhờ krock là tốt. – riship89

+1

Trên Debian, nó đủ để cài đặt gói 'libjsch-java'. – user3132194

4

Thanh toán các library dependancies cho nhiệm vụ scp. Bạn cần phải bao gồm jsch.jar trong classpath của bạn.

+0

cảm ơn ... sự cố của tôi đã được giải quyết. – riship89

-2

Thêm tệp JAR JSch JAR vào trong Eclipse - Windows> Tùy chọn> Ant> Classpath.

Bạn có thể lấy số JAR file từ Kho lưu trữ trung tâm Maven.