SSH Tasks for Ant 1.5.x

With Ant 1.6.0 two new tasks have been added that allow users to execute commands via SSH or use scp to transfer files to a remote server securly.

These new tasks are mostly independent of changes in Ant 1.6, so we decided to make the tasks available to users who can't upgrade Ant easily as a separate library. We encourage all our users to upgrade to the latest version of Ant.

This distribution contains the Ant tasks <sshexec> and <scp> compiled against Ant 1.5.4. They may work with older distributions of Ant as well but haven't been tested with any other version. These tasks require additional software that is not part of this distribution.

Installation

The easiest way to use the tasks is to use

      <taskdef resource="org/apache/tools/ant/taskdefs/optional/ssh/sshtasks.properties">
        <classpath>
          <pathelement location="your/path/to/ant-ssh.jar"/>
          <pathelement location="your/path/to/jsch.jar"/>
        </classpath>
      </taskdef>
    

in your build file. If ant-ssh.jar is on your CLASSPATH or in ANT_HOME/lib you can even simplify this to read

      <taskdef resource="org/apache/tools/ant/taskdefs/optional/ssh/sshtasks.properties"/>
    

Note that JSch has to be on your CLASSPATH or ANT_HOME/lib as well, if you use the last approach.

Usage

The manual pages for the tasks:

Library Dependencies

The tasks are based on the BSD licensed SSH library JSch that is not part of this distribution. Please note that JSch requires JCE, which is part of JRE 1.4.0 and later, but you may need to install additional software for JRE 1.2.2 or 1.3.x - please consult the JSch documentation for more details.


Copyright © 2004 Apache Software Foundation. All rights Reserved.