title: Configure Apache Ant to be used behind a proxy
body: <p>I am trying to configure Apache Ant to be used behind a proxy, I am using MAC OS El Capitan, and I have a bash_profile that I know is being sourced by my terminal, I have this in my bash_profile to configure ANT for the proxy:</p>
  
  <pre><code>export ANT_OPTS=-Dhttp.proxyHost=myproxyhost -Dhttp.proxyPort=8080 -Dhttp.proxyUserName=myproxyusername -Dhttp.proxyPassword=myproxypassword -Dhttps.proxyHost=myproxyhost -Dhttps.proxyPort=8080
  </code></pre>
  
  <p>After I open my terminal I can <code>echo $ANT_OPTS</code> and I can see it is being loaded, I also now that when running an Ant Script that is trying to download a URL it is indeed picking up ANT_OPTS because it is going thru the proxy, however every single time I am getting:</p>
  
  <pre><code>[get] Error opening connection java.io.IOException: Server returned HTTP response code: 407
  </code></pre>
  
  <p>It tries 3 times and then bails out. If I remove <code>ANT_OPTS</code> then I just get a time out error as expected.</p>
  
  <p>I know the error code is telling me that my credentials are incorrect or not provided, but I have made sure they are correct, is there another way that the proxy credentials should be provided to <code>ANT_OPTS</code>?, I tried <code>-Dhttp.proxyUserName and -Dhttp.proxyUser</code> to no avail.</p>
  
  <p>This is my ant version:</p>
  
  <pre><code>Apache Ant(TM) version 1.9.7 compiled on April 9 2016
  </code></pre>
  
  <p>Java version:</p>
  
  <pre><code>java version "1.8.0_66"
  Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
  Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
  </code></pre>