ANT Installation for Salesforce deployments

I. Download ANT Apache:
------------------
1. Download ANT apache : click ANT FILE, you can see ".zip archive" file link under "Current Release of Ant" section, you might get this tipe of zip file : "apache-ant-1.9.6-bin.zip" (july 2015 version), and also download Java JDK FILE
------------------

Ant Apache :



II. Installation:
------------------
2. Copy/cut the zip file for example : "apache-ant-1.9.6-bin.zip".
3. Go to any drive, for example "D", and create 1 folder name "ANT".
4. Paste the zip file under "ANT" folder
5. Extract the zip file , by right click "Extract here" (do extract in same folder), you see 1 folder(like : "c") click the folder, you can see 4 folders and n number of files, for us "bin" and "lib" is important.
------------------

III. Integrate with Salesforce:
------------------
6. Download salesforce migration tool : Login to salesforce and navigate to “Your Name |Setup | Develop | Tools” and download “Force.com Migration tool”. You might get the file name "salesforce_ant_34.0.zip" (version could be change 34.0 is for summer15).
7. Copy/cut the zip file for example : "salesforce_ant_34.0.zip".
8. Go to the same drive and folder as mentioned in step 3, for example "ANT" folder in "D" drive which we discussed.
9. Paste the zip file under "ANT" folder
10. Extract the zip file , by right click "Extract here" (do extract in same folder), you see 1 "sample" folder, 1 "ant-salesforce.jar" file, 1 "Readme.htm", for us "Sample" and "ant-salesforce.jar" is important.
 - ant-salesforce.jar : for salesforce and ANT integration (How? you will get to know later)
 - Sample folder : for deployment/retrive/delete metadata in any org.
11. Now Copy "ant-salesforce.jar" file.
12. And go to the apache ant folder then go to "lib" folder, which we discussed in step 5 ("apache-ant-1.9.6/lib" folder) open the folder and paste  "ant-salesforce.jar" file there.
-----------------

IV. Create Environmental variable in system : 
-----------------
13. Go to "Start" | "Computer" (right click on computer) / You also can go to "My Computer" right click.
14. Go to "Properties"
15. Select "Advanced system settings".
16. In the "Advanced" tab, select "Environment Variables".


17. Create 2 new variable and modify 1 existing variable in "system variable" section, as mentioned below :

 a. Click new button Give variable name "ANT_HOME" and variable value with the path where you install the apache ant (as discssed IInd section steps 2,3,4 and 5), for example "D:\Ant\apache-ant-1.9.6", click "ok"

 b. Again click new button Give variable name "JAVA_HOME" and variable value with the path where you have JAVA JDK mostly in : "C:\Program Files\Java" ,provide variable value like : "C:\Program Files\Java\jdk1.6.0_45", click "ok"
  - To install Java, go to http://www.oracle.com/technetwork/java/javase/downloads/index.html and get the latest version of the Java JDK. When you’re finished with the installation, verify by typing "java -version" at a command prompt.

 c. Modify existing variable name "path" add this "%ANT_HOME%\bin;%JAVA_HOME%\bin;" in start.
  - Note : Don't remove the existing path just add this one as well before existing path, also take care of path should not have any spaces n all

V. Test Ant version:
-----------------
18. Go to command prompt (go to "Start" | "Run" | type "cmd")
19. Run "ant -version", for example - C:\Users\xyz>ant -version
 - result should be like this "Apache Ant(TM) version 1.9.6 compiled on June 29 2015"

Comments

  1. Perfect one, could not find such an article earlier. Thanks for d effort buddy.

    ReplyDelete

Post a Comment

Popular posts from this blog

Understanding the common UNABLE TO LOCK ROW issue with bulk data job

Create Salesforce bulk API job with Workbench

Sorting the list rows via apex Comparable interface