TIBCO BusinessEvents Maven Plug-in Phases

TIBCO BusinessEvents Maven plug-in overrides the Apache Maven phases with respect to TIBCO BusinessEvents. Thus, running the same Maven phases, you can build or deploy BusinessEvents applications. The BusinessEvents Maven plug-in also adds a buildProjectLib build lifecycle for building and installing the project library.

The Maven phases refer to the pom.xml file of the BusinessEvents application for the required arguments. See BusinessEvents Application POM File for more details about the BusinessEvents application pom.xml file.

You can call to run a Maven phase in the command prompt using the following syntax:

mvn <phase>

In a build lifecycle, the phases are run sequentially to complete the build lifecycle. It means that whenever you call a phase to run in the lifecycle, all the previous phases are completed in sequence. Thereafter, the phase that you have called is run. For example, you have called the install phase:

mvn install
In such cases, first the compile phase is run, then the test phase, then the package phase, and finally the install phase is run.

The following tables list (in sequence) all the phases available in the BusinessEvents Maven plug-in.

BusinessEvents Maven Plug-in Phases for Maven default Lifecycle
Phases Description
compile Compiles the BusinessEvents project.

The useLegacy tag in the pom.xml file specifies whether to use Legacy Id or key-based lookup. The default value is false and key-based lookup is enabled for the project. Some of the previous projects that are imported in the version 6.3.1, may have the Legacy Id set to true. In such cases, the value in the pom.xml file for useLegacy tag is true.

test Runs BusinessEvents JUnit tests in the BusinessEvents project under the JavaSrc folder. The test-compile phase that runs before the test phase checks whether the project contains test resources existing in the testSource directory JavaSrc folder. This directory can be overridden by setting the testSourceDirectory property. It searches for the BusinessEvents JUnit tests with the following file names:
  • **/Test*.java
  • **/*Test.java

It compiles the test resources and runs the JUnit test suite.

Note: Ensure that the EAR file location in the JUnit test suite file is the same as the EAR file location specified in the pom.xml file.
package Compiles the BusinessEvents project and builds the EAR file at the location specified in the pom.xml file.

The <earLocation> tag in the pom.xml file for the BusinessEvents application specifies the location to store the generated EAR file.

install Installs the BusinessEvents project's EAR file and pom.xml file into your Maven repository.
deploy Deploys the BusinessEvents project EAR and the project library into the remote repository.

To deploy the project library into a remote repository, you must first build the project library at the location specified by the <projLibLocation> tag in the pom.xml file.

Specify the remote repository details in the project's pom.xml file and create$USER_HOME/.m2/settings.xml a file for repository authorization.

BusinessEvents Maven Plug-in Phases for buildProjectLib Lifecycle
Phases Description
build-project-lib Builds the project library (.projlib) for the BusinessEvents project.

The <projLibLocation> tag in the pom.xml file, for the BusinessEvents application, specifies the location to store the generated project library (.projlib) file.

install-project-lib Installs the project library (.projlib) for the BusinessEvents project to your Maven repository.
BusinessEvents Maven Plug-in Phases for Hot Deploy in TIBCO Enterprise Administrator
Phases Description
hot-deploy Deploys the generated EAR file for the BusinessEvents application deployed on TIBCO Enterprise Administration Agent. All the earlier phases until the install phases are run and the generated EAR file is deployed on the TIBCO Enterprise Administrator server specified in the pom.xml file.
<teaConfig>
        <teaUrl>http://localhost:8777</teaUrl>
        <applicationName>FraudDetection</applicationName>
        <username>admin</username>
        <password>admin</password>
</teaConfig>

You can skip the earlier phases by using the property disablePhases. You can add this property in the project pom.xml file inside the tag beProjectDetails. The value must be a comma-separated list of all the phases needed to be skipped. The phase that should be skipped must have be as a prefix.

Example:

<disablePhases>bebuildear</disablePhases>
Note:
  • The TIBCO Enterprise Administrator server and TIBCO Enterprise Administration Agent must be running and the respective BusinessEvents application must be deployed on it.
  • The Hot Deploy option in CDD must be selected for hot deployment to work.
BusinessEvents Maven Plug-in Phases for Docker
Phases Description
build-app-image

Builds the Docker image for the TIBCO BusinessEvents application. You can specify the following arguments that are required for the Docker image generation in the pom.xml file.

Copy
<appImageConfig>
    <scriptPath/>
    <docker_dir/>                                                        
    <image_type/>
    <app_location/>                            
    <source/>
    <config_provider/>
    <enable_openjdk/>
    <enable_optimize/>
    <build_tool/>
    <modules/>
    <help/>                                                        
    <disable_tests/>                                
    <be_home/>
    <tag/>
    <dockerfile/>
</appImageConfig>

Following are the descriptions for the tags used:

Tag Description
scriptPath

Path to the script to be run.

docker_dir

Path to the directory where the Docker scripts are located.

image_type Type of the image to build ("app"|"rms"|"teagent"|"s2ibuilder").
app_location Path to the TIBCO BusinessEvents application where the project CDD, EAR, and optional supporting JAR files are located. This is a required tag if the image-type is app.

source

Path to BE_HOME or TIBCO installers.

config_provider

(Optional) Name of the config provider to be included in the image ("gvconsul"|"gvhttp"|"gvcyberark"|"cmcncf"|"custom").

enable_openjdk

(Optional) Specifies to use OpenJDK instead of the bundled Oracle JDK.

Place the OpenJDK installer archive in the same folder on the file system where TIBCO installers are placed.

enable_optimize

(Optional) Optimizes the container image creation.

If available, it automatically retrieves the required modules from the project CDD or EAR file.

build_tool

Build the container image using build tools ("docker"|"buildah").

The default is "docker".

modules (Optional) Accepts additional module names as a comma-separated string. For example, "HTTP, kafka".
help

(Optional) Print the usage of the script.

disable_tests

(Optional) Disables docker unit tests on created image (applicable only for "app" and "s2ibuilder" image types).

tag

(Optional) Name and optionally a tag in the 'name:tag' format.

dockerfile

(Optional) Dockerfile to be used for generating the image.

You can build the Docker image either by using an existing TIBCO BusinessEvents installation (BE_HOME) from your computer or using the software installer of TIBCO BusinessEvents and other required products. The Docker image generated by using software installers is of smaller size in comparison to the Docker image generated using your TIBCO BusinessEvents installation.

  • Docker image by using software installers - Set <useBEHome> to false and provide the location of the TIBCO BusinessEvents, TIBCO ActiveSpaces, and other add-ons installers in <installers_location>.
  • Docker image by using an existing TIBCO BusinessEvents installation - Set <useBEHome> to true and provide a BE_HOME path in <be_home>.

See "Building BusinessEvents Application Docker Image" section in the TIBCO BusinessEvents Cloud Deployment Guide for more details about the arguments required for Docker.

Note: In the macOS platform, ensure to provide the system PATH as an environment variable in the Run configuration. In TIBCO BusinessEvents Studio, right-click the project name and select Run As > Run Configurations > <Target_run_configuration>. In the Environment tab, add a variable PATH and provide its value the same as $PATH environment variable value from the system.
docker-install Runs all the earlier phases for the Dockerfile and installs the BusinessEvents project's EAR file and pom.xml file into your Maven (.m2) repository.
docker-deploy Creates a tag for the generated application image and deploys the tagged image to the specified Docker registry. All the previous phases are run and then the docker-deploy phase is run.
Note: For deploying to Amazon Web Services (AWS), you must have the AWS Command Line Interface (CLI) installed and configured on the system.

You can specify the following arguments that are required for deploying the application Docker image in the pom.xml file. Specify the repository name and URL required for the deployment.

Copy
<dockerRegistryConfig>
       <property>
            <key>Repository</key> //Repository Name
            <value/>
       </property>
       <property>
             <key>Url</key>   //Repository Url
             <value/>
       </property>
       <property>
              <key>TagImage</key>   
              <value>RepositoryName:ImageName</value>
        </property>
</dockerRegistryConfig>