Installing Force.com Migration Tool (Ant) on Mac OsX

I was trying to run ANT to migrate code between two Salesforce orgs today and realized I hadn't configured the Force.com Migration Tool properly for my new Mac. I kept getting the error; [antlib:com.salesforce] Could not load definitions from resource com/salesforce/antlib.xml. It could not be found.

I already had the latest version of Eclipse installed, which handles the Ant installation for you. You can confirm this by typing ANT-version in Terminal. So, it was just a question of getting the migration tool in the Ant lib directory. (This took me a bit of searching hence this quick post).

  1. Download the Force.com Migration Tool (instructions here).
  2. Unzip the file
  3. Open a terminal window in the directory of the unzipped file (See my last post for a quick way to do this)
  4. Type: sudo sh
  5. Enter your password
  6. Type: cp ant-salesforce.jar /usr/share/ant/lib/ant-salesforce.jar

Now you're good to go. Check out Jeff Douglas' blog post on the hows and whys of this tool.

Advertisements

Open Finder Window in Terminal

One of the few (maybe only) things I miss from my Windows days, was the abilty to right-click a window in Explorer and select 'Open Command Window Here'.

01openpromptheres

Mac's Finder doesn't has a similar function, which is a bit of a pain when I want to run ANT (aka Force.com Migration Tool ) to quickly get code in/out of a Salesforce org.

In the past, I used Automator and a Applescript to do this. But, recently I found a nice toolbar shortcut, called CdTo, that does this with one click.

  1. Download the zip file from here.
  2. Unzip the file and copy the CdTo application for your OSX version to your Applications directory. (I put my copy in Utilities)

    Cdto

  3. Drag and drop the CdTo app to the Finder toolbar.

    Cdto2

  4. Now you see a new icon on the Finder window. From now on you can click that to open the current Finder folder in Terminal.

    Cdto3