1

How to configure proxy settings for TIBant

If you're working in a corporate environment, your HTTP traffic will typically be routed through a proxy as part of your company's security policy.

If you haven't yet configured Ant to use this proxy (and TIBant by association), then you'll get errors similar to the following when attempting to run TIBant for the first time:

BUILD FAILED
c:\YourProject\build.xml:10: Cannot find http://windyroad.com.au/bwunit-importer/16.15/full.xml imported from c:\YourProject\build.xml
    at org.apache.tools.ant.taskdefs.ImportTask.importResource(ImportTask.java:182)
    at org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:163)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180)
    at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
    at org.apache.tools.ant.Main.runBuild(Main.java:826)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

 

  1. First things first, find out your proxy details. If you're not sure where to find these details, your network administrator should be able to help you. At a minimum, it will consist of a hostname and port.
  2. Secondly, you will need to configure/tell Ant to use the proxy details. I'm going to provide the simplest solution, but if you'd like to explore the different configuration options, please continue reading the Ant Proxy Configuration documentation. The following steps describe how to configure the proxy using the ANT_OPTS environment variable in Windows 7.
    1. Press the Windows Key, and Search for "Edit the system environment variables" (open the first result)
    2. Click on the Environment Variables button
    3. Add a new User (or System if you want) Variable by clicking the New button
    4. Provide the name 
      ANT_OPTS
    5. Provide the value 
      -Dhttp.proxyHost=your_proxy -Dhttp.proxyPort=your_proxy_port
    6. Save and close all windows, and restart your command prompt. You should be able to check the value by executing:
      echo %ANT_OPTS%
    7. Now rerun your Ant command, and the TIBant resources should be downloaded succesfully.

 

0 comments

Please sign in to leave a comment.