| «« Baby Steps | May CD Run Review »» |
|
About
I'm Ryan Lowe, a Software Engineering graduate living in Ottawa, Canada. I like agile software development and Ruby on Rails.
I write this blog in Canadian English and don't use a spell checker. Typos happen.
Projects
» Full-time Ruby on Rails freelancer
» Full-time with Rails since May 2005 » Former committer for RadRails (now Aptana) » I also have a few Rails side-projects in development: 1. wheretogoinTO.com Toronto nightlife 2. Hey Heads Up! TODO list and sharing 3. Layered Genealogy family history research 4. foos for foosball scoring 5. fanconcert for music fans (on hold) Hiring Rails developers? I can telecommute by the hour from Ottawa, Canada »» Email: rails AT ryanlowe DOT ca
BulletBlog
Now hosted on Hey! Heads Up -- check it out!
Syndication
Pings
Recent
blog@ryanlowe.ca no more
Forging Email Headers: Good, Bad or Ugly? Sarcastic Dictionary (Part 1 of Many) Tags Hierarchies Twisting Rails is Risky Business Risky Business? My Take on Early Alphas Whoa, it's August 2007 Closing Comments A Postscript to "Growth at the grassroots" An Abuse Trifecta »» All Blog Posts
Linkage
del.icio.us/ryanlowe
technorati/ryanlowe.ca/blog Aurora Roy Jim Andrew Trasker Travis Kibbee Karen Dr. Unk Ayana Van Bloggers Joel Spolsky Robert Scoble Tim Bray Dave Winer Raymond Chen James Robertson Ruby/Rails Bloggers rubyonrails.org weblog David Heinemeier Hansson Dave Thomas James Duncan Davidson Mike Clark Jamis Buck Signal vs. Noise Tobias Luetke Amy Hoy: (24)slash7 Jeremy Voorhis Eclipse Bloggers Planet Eclipse EclipseZone Luis de la Rosa Eclipse Foundation Kim Horne Billy Biggs Ian Skerrett Mike Milinkovich Bjorn Freeman-Benson Denis Roy
Archives
|
Using Ant's FTP Task
I'm going to be doing AudioMan's builds on one machine and uploading them to a web server with FTP so people can download them. The easiest way to do this was with Ant, the tool I use to build AudioMan. After building the project Ant already knows all of the details of the build it just did -- where it is, what all of the files are, etc. One small problem though: <ftp> is an optional Ant task and requires an external library. What the documentation doesn't tell you is that Ant 1.6 requires a different external library file from Ant 1.5. That's what happens when you read the docs for 1.6 using 1.5, right? :) It would still be nice to know it changed. I Googled for it, and found the info telling me that it changed. So that's handy, I was using the wrong JAR file. Just for the record: Ant 1.5 requires NetComponents.jar which you can get here. --- Here's a tip for the ftp task: If your Ant file is in a publicly accessible place like an open source CVS repository, you probably shouldn't put your password right in the Ant task like: <ftp server="someftpserver.com" userid="user" password="god"> because people will know your FTP password! You're better off using a property, which you can leave blank in the Ant build.xml file and specify at the command line instead. Then the checked in file won't have a password in it and only the people that know the password can use this task. Here's the new Ant file: <property name="ftp.password" value="" /> <ftp server="someftpserver.com" userid="user" password="${ftp.password}"> and here's how to use the command line to specify the password and run the ftp task: ant -Dftp.password=god ftp Posted at May 23, 2004 at 02:41 AM ESTLast updated May 23, 2004 at 02:41 AM EST Comments
Hey, -Deepak » Posted by: Deepak at May 25, 2004 10:29 AMHi Thanks for this posting. it was great and solved my problem right away tooooooo.... Hooray for the net. » Posted by: Lakshman at June 16, 2004 12:41 AMGood work:) Thanks... it help me too :) » Posted by: Swistak at June 18, 2004 07:09 AMYep, worked for me too. Thanks. » Posted by: Shance at September 21, 2004 10:01 PMThanks for this information. Do you know of any way to use the Ant FTP task to send an arbitrary command to the ftp server? thomas: It looks like this is not possible with the current version of Ant (1.6.2). There is a list of allowed "actions" that you can use instead of letting people use arbitrary commands. » Posted by: Ryan at October 13, 2004 05:09 PMHi, Thanks and Regards, Yamini, check out the FTP task in the Ant manual It looks like it's the "remoteDir" attribute. Cheers » Posted by: Ryan at October 27, 2004 08:34 AMHi, this works great, I however have a problem to use the "newer" option with downloads from different (eastward) timezones. It downloads the same file again if they are younger than the timezone difference. How do you handle this cases? » Posted by: chris at November 17, 2004 03:37 PMThanks for the post of not only what the newer Ant required for FTP but also the links. Once I found your blog I literally had it up and running in 1 minute. Thanks! » Posted by: J.R. at December 1, 2004 01:23 PMHi This is great posting. With this change in file I was sweating over and could not find any solution. I am sure this will solve my problem. Thanks for sharing. pranav » Posted by: Pranav at April 27, 2005 09:45 AM |