ant scp failure

16,727

Solution 1

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.

Solution 2

Checkout the library dependancies for the scp task. You need to include jsch.jar in your classpath.

Share:
16,727
hrishikeshp19
Author by

hrishikeshp19

Engineer

Updated on June 04, 2022

Comments

  • hrishikeshp19
    hrishikeshp19 almost 2 years

    This is how I am trying to scp to a remote machine, I am trying to copy whole directory to destination directory.

    <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