Specifying an External Library Location Using Build Path Variable

You can use variables (aliases) to specify an external library location in project build path to build a project using studio-tools in TIBCO BusinessEvents. You can store the third party JARs, custom function JARs, and .projlib files in different locations on your local machines and refer to them through aliases. To perform common builds on a build machine, the aliases are used to create the full path to common JAR files.

Procedure

  1. Open the project in TIBCO BusinessEvents Studio.
  2. In BusinessEvents Studio Explorer, right-click the project and click Properties (or press Alt-Enter).
    You see the Properties dialog for the project.
  3. In the left panel, select Build Path and select Custom Functions tab.
  4. Click Add Variable.
    The New Variable Classpath Entry window is displayed.
  5. Click Configure Variables.
    The Preferences window is displayed to add a new variable.
  6. Click Add.
    The New Variable Entry window is displayed.
  7. In the Name field, enter the new variable name (for example, CUSTOM_HOME) and in the Path field enter the path and click OK three times.
    The new variable is now added to the build path.

Result

The variable is used as a placeholder in the build path. Define the value of that variable on your local machine (for example, C:\dev\mycustomjars\), and similarly define the value on the build machine. Thus, there are no hard-coded paths to the custom function, or third-party project library entries, but only the relative ones.
The two methods using which you can specify where to find the JAR files during deploy time are:
  • Using classpath (-cp) option - In the command-line specify the path of the JAR files in the -cp command line option for the classpath. For example:
    studio-tools.exe -cp c:\logs\677138\cf-logger51.jar -core buildEar -o c:\temp\hello.ear -p C:\Logs\677138\HelloWorld_with_CustomFunction
  • Using the studio-tools.tra file - In the studio-tools.tra file, which is used to build the EAR file on the build machine, add the following property for each defined variable:
     java.property.CUSTOM_HOME=C:/Logs/677138/

    where, CUSTOM_HOME is the name of the variable.

    Now you can build EAR without specifying classpath in the command, for example:
    studio-tools.exe -core buildEar -o c:\temp\hello.ear -p C:\Logs\677138\HelloWorld_with_CustomFunction
    Note: Do not put the name of the JAR file at the end when specifying the value of the property. In the studio-tools.tra path, forward slashes are used.