Using the Ant FTP Task in Eclipse

And here is another joy of ANT – you can move files by FTP. Its not one of the core tasks in ANT, so you can be forgiven for trying it, and it not working. Go check out the ANT Manual FTP Task page and it tells you the components you require. The Commons is […]

And here is another joy of ANT – you can move files by FTP. Its not one of the core tasks in ANT, so you can be forgiven for trying it, and it not working. Go check out the ANT Manual FTP Task page and it tells you the components you require.

The Commons is a Jakarta subproject focused on all aspects of reusable Java components. At the time of writing I used the 1.4.1 from Jakarta,. Now you also need the ORO: The Jakarta-ORO Java classes are a set of text-processing Java classes that provide Perl5 compatible regular expressions, AWK-like regular expressions, glob expressions, and utility classes for performing substitutions, splits, filtering filenames, etc. I used 2.0.8. Now open up both of these zip files and you will find some jar files. In order to run these from within Eclipse you should drop them somewhere sensible. I figure that the workspace folder would be good so I moved

  • commons-net-1.4.1.jar
  • jakarta-oro-2.0.8.jar

into my c:\development\workspace folder. Of course if you would like it to be available across workspaces you could use the ANT folder in


Once you have placed your jar files, 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 c:\development\workspace or wherever you unzipped the jar files
  7. Select the 2 .jar files
  8. Open > Apply > OK
  9. Restart Eclipse

You should now be able to use the following to make it happen, this example sends the contents of the c:/temp directory:

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.