How to add a proxy configuration to execute a Command Line Interface (CLI) script.

How to add a proxy configuration to execute a Command Line Interface (CLI) script.

book

Article ID: KB0084399

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix Service Grid -
TIBCO BPM Enterprise (formerly TIBCO ActiveMatrix BPM) -
TIBCO ActiveMatrix BusinessWorks Service Engine -

Description

Description:
It has a proxy placed between ActiveMatrix(AMX) Administrator and client, and user wants to add proxy configuration to execute the AMX CLI (Ant) script.

Issue/Introduction

How to add a proxy configuration to execute a Command Line Interface (CLI) script.

Resolution

Any JVM can have its proxy options explicitly configured by passing the appropriate "-D" system property options to the runtime. An ANT can be configured through its shell scripts via the ANT_OPTS environment variable, which is a list of options to supply to ANT's JVM. 

For bash:
    export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"

For csh/tcsh:     setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"

If you insert this line into the ANT shell script itself, it is picked up by all continuous integration tools running on the system that call ANT via the command line. For Windows, set the ANT_OPTS environment variable in the appropriate "My Computer" properties dialog box (Windows XP) or "Computer" properties (Windowa Vista). This mechanism works across Java versions as it is cross-platform compatible. Once set, all build files running via the command line will automatically have their proxy setup correctly without needing any build file changes. It also overrides ANT's automatic proxy settings options.

It is limited in the following ways.

 

1). It does not work under IDEs. These need their own proxy settings changed.


2). It is not dynamic enough to deal with laptop configuration changes.

If a user uses an ANT from <TIBCO_Home>\amx\3.3\bin  to execute the AMX ANT script, the ANT_OPTS can be add in the  <TIBCO_Home>\amx\3.3\bin\ant.tra  file.

Additional Information

https://ant.apache.org/manual/proxy.html