Hello Friends,
Many developers are facing the issue of setting up ANT Migration
Tool for Salesforce with Proxy Settings. Today, I have jotted down all the steps to setup this
tool.
Steps:
1. Download the
Apache ANT from the google.
Download
link: http://ant.apache.org/bindownload.cgi
2. Unzip it and
put it any drive. Let’s say, for example D drive. You can keep the name as ANT_HOME(Optional).
3. Download the zip file from the Salesforce
website and place it anywhere like desktop:
4. Unzip the
step-3 downloaded file and copy the "ant-salesforce" JAR file to the lib folder where you have copy pasted
the ANT_HOME folder as shown below:
5. Now, install
JDK and install it in C drive.
Right click My Computer and click on properties.
Click on Advanced
System Settings on the left panel.
A new popup window will show up and click on Environment Variables.
Now you can set JAVA and ANT path.
Create one System Variables with JAVA_HOME and give the path till bin folder
of JAVA JDK as given below:
Once the JAVA_HOME variable is set, click on path
and then click edit.
Add two things as shown below as per location:
%JAVA_HOME%\bin will copied as it is.
7. All Set! Next thing is to test the ANT setup
in the command prompt.
8.
Type ant -version and you should see the below
response:
9.
Congratulations!!
DATA Retrieval and Deployment
Retrieval
2.
Open the sample folder as shown in step-4.
3.
There you will see two most important files for
configuring the ANT.
3.1 Build Properties
3.1.1
This file contains the login information like salesforce username and password
and the connecting salesforce org.

3.1.2
Provide your username of salesforce and password along with the security token.
3.1.3
If your company is having any sort of proxy setting then you may need to write
additional code in this file.
proxy.host = <your company host>
proxy.port = <your company port>
proxy.user = <your company’s username>
proxy.port = <your company port>
proxy.user = <your company’s username>
proxy.pwd = <your company’s password>
3.1.4
If there are no firewall or proxy settings
from your company then you can skip the above step.
3.1.5
You are done with the configuration of
Build.Properties file.
3.2 Build.xml
3.2.1
Modifications are required if you want
to do some proxy related things or else you can skip this.
3.2.2
Add the below code in the end of the file and enter the value in each tag:
<target
name="proxy">
<property
name="proxy.host" value="" />
<property
name="proxy.port" value="" />
<!--If there username and password
required -->
<property
name="proxy.user" value=" " />
<property name="proxy.pwd"
value=" " />
<setproxy
proxyhost="${proxy.host}" proxyport="${proxy.port}"
proxyuser="${proxy.user}" proxypassword="${proxy.pwd}"
/>
</target>
3.2.5
Now you are good to go.
4.
Open Command Prompt and enter the directory sample as defined in Step-3 and keep
this aside.
5.
Open the folder unpackaged and open package.xml.
6.
Create a similar package like
show below as per your requirments
7.
Package is ready and it’s time to do some
magic.
8.
Write the command ant retrieveUnpackaged on the command prompt.
9.
Proxy user will see their proxy username and non-proxy
user will not see this.
10.
After successful run you will see a new folder
in your sample directory with name as
retrieveUnpackaged
11.
Open this folder and you will find the components
which you have entered in the package in step-6.
Deployment
1.
You need to be very careful, while deploying
the components to the other environments.
2.
Firstly, change the username and password in build.properties file and give the
target org’s credentials.
3.
Change the sf.serverurl to the target org’s
URL and save it.
4.
Open the command prompt and type ant deployUnpackaged.
5.
Your components will be deployed to the other
environment.
6.
If there is any error, it will rollback.
Kindly Share your feedback and let me know if there are any issues!
Kindly Share your feedback and let me know if there are any issues!
Do let me know your views on this.
Great! Helps lot...
ReplyDeleteGreat information, thanks for the help👍
ReplyDeleteKya baat hai��
ReplyDeleteWelcome :)
ReplyDeleteHello all,
ReplyDeletejust a question. I have a build.xml file with several targets.
I define one target in Jenkins but since the default in build.xml is different, always run the default and ignore the target defined in the job in Jenkins. If i change the default it will run the new target. Anyone know what can be the root cause to ignore Jenkins configuration?
Thank you.
Great stuff!! thanks for the.
ReplyDeleteResolved my query.thanks
ReplyDelete1xbet | 1xbet | Bet with a Bonus - RMC | Riders Casino
ReplyDelete1XBet allows you to bet on 1xbet app any febcasino favourite 출장마사지 horse races or any other sporting event. https://septcasino.com/review/merit-casino/ ✓ kadangpintar Get up to £300 + 200 Free Spins No Deposit
Really Helpful with Proxy.
ReplyDelete