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).
- Download the Force.com Migration Tool (instructions here).
- Unzip the file
- Open a terminal window in the directory of the unzipped file (See my last post for a quick way to do this)
- Type: sudo sh
- Enter your password
- 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.