SixFive...

Using sshexec from ANT in Eclipse for build files

Following on from other posts, we continue to improve our build files for deployment of client sites. Our latest addition is the sshexec task for clients using Linux or a LAMP environment to host their site. Our build files move the code out of SVN, zip it up, commit the build record back to SVN, […]
June 19, 2009 9:24 am

Using sshexec from ANT in Eclipse for build files

Following on from other posts, we continue to improve our build files for deployment of client sites. Our latest addition is the sshexec task for clients using Linux or a LAMP environment to host their site. Our build files move the code out of SVN, zip it up, commit the build record back to SVN, and FTP the resulting file to the site. With ssh we can now unzip the file and have ANT do all the work for us. sshexec is not one of the core tasks in ANT, you can find out about ANT dependacies here. Currently you need jsch.jar 0.1.29 or later from the JCraft Java Secure Channel project.

Place the JAR file into [eclipseroot]\plugins\org.apache.ant_1.7.0.v200803061910\lib directory

Once you have placed your jar file, you need to get Eclipse to load them at runtime. I read somewhere that using the ANT folder above and a simple restart would have Eclipse pick them up, but that didn’t work for me.

  1. Open Eclipse
  2. Window > Preferences
  3. Ant > Runtime
  4. Ant Home Entries (Default)
  5. Click Add External JARs
  6. Navigate to [eclipseroot]\plugins\org.apache.ant_1.7.0.v200803061910\lib or wherever you unzipped the jar files
  7. Select the jsch.jar file
  8. Open > Apply > OK
  9. Restart Eclipse

You should now be able to use the following target to make it happen, this example unzips a predefined zip file:

Leave a Comment