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, […]
Last updated: March 11, 2012

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

Duncan Isaksen-Loxton

Educated as a web developer, with over 20 years of internet based work and experience, Duncan is a Google Workspace Certified Collaboration Engineer and a WordPress expert.
Login
Log in below to access your courses.
Log In With Google
Forgot Password
Enter your email address or username and we’ll send you instructions to reset your password.