As of version 1.1 we now support the scp protocol to copy files to a remote host. To enable the scp configuration we beefed up the the piecesofflare config. In step 4 of the instructions we first introduced the piecesofflare config file which lives in the root of the project. An example of version 1.1 of this file is given below.

The piecesofflare.xml config file:

<synchronizedDirectories debug="true">
       	<SynchronizedDirectory>
		<name>velocity and jsps</name>
		<extensions>.vm,.jsp,.html</extensions>
		<fromdir>C:/cygwin/home/kstam/dev/abccms_bugfix/web/</fromdir>
        <todir>scp://apps/jboss-3.2.6/abc_bugfix/server/default/deploy/abc.ear/abc.war/</todir>
        <remoteHost>www.osconsulting.org</remoteHost>
        <username>kurt</username>
        <password>secret</password>
        <pathToPrivateKey>C:/cygwin/home/kstam/.ssh/id_dsa</pathToPrivateKey>
        <passPhrase>very very secret</passPhrase>
    </SynchronizedDirectory>
</synchronizedDirectories>

Newly added configuration tags are high-lighted in red. All new fields are optional. If you want to use the scp protocol you need to prefix the toDir path with 'scp://'. Next you can pick either combination of

  • remoteHost, username and password,
  • remoteHost, username and pathToPrivateKey, or when your passPhrase is not empty:
  • remoteHost, username, pathToPrivateKey and passPhrase

Note the newly added debug attribute. When things are working happily, you can now suppress all info level debug output by setting debug="false". Error level logging will still be written.

Thank you JCRAFT for putting together an excellent all java SSH2 implementation.

Copyright © 2005 - 2008, Kurt Stam, Tom Cunningham