How to set Proxy Settings in Ant deployment in Salesforce?

Code to be added in build.properties:

proxy.host = Proxy_Host
proxy.port = Port_Number
proxy.user = Username
proxy.pwd = Password

Code to be added in build.xml:

<target name="proxy">
<property name="proxy.host" value="${proxy.host}" />
<property name="proxy.port" value="${proxy.port}"/>
<property name="proxy.user" value="${proxy.user}"/>
<property name="proxy.pwd" value="${proxy.pwd}"/>
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.user}" proxypassword="${proxy.pwd}" />
</target>

Cheers!!!

1 comment:

  1. I am getting this error when i am using ' ant retrieveUnpackage ' command. Any help would be greatly appreciated. I stuck with this issue for a long time

    BUILD FAILED
    Target "autoproxy" does not exist in the project "Sample usage of Salesforce Ant
    tasks".

    ReplyDelete