Ant crash scp

This is how I try to execute scp to a remote machine, I try to copy the entire directory to the destination directory.

<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> 

I get the 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 optional JARs you need the JAR files that the optional tasks depend upon. Ant 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 
+6
source share
3 answers

The error output is pretty clear 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 are missing a jsch JAR file that can be downloaded from the JSch website.

+7
source

Checkout library dependencies for scp task. You must include jsch.jar in your classpath.

+4
source

Add the JSch file to Eclipse - Windows> Preferences> Ant> class path.

You can get the JAR file from the Maven Central repository.

-2
source

Source: https://habr.com/ru/post/918418/


All Articles