BusinessEvents Maven Plug-in Phases

TIBCO BusinessEvents Maven plug-in overrides the Apache Maven phases with respect to TIBCO BusinessEvents. Thus, executing 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 refers to the POM file of the BusinessEvents application for the required arguments. See BusinessEvents Application POM File for more details on the BusinessEvents application POM file.

You can make call to execute a Maven phase in the command prompt using the following syntax:
mvn <phase>
In a build lifecycle, the phases are executed sequentially to complete the build lifecycle. It means that whenever you call for a phase to execute in the lifecycle, all the phases before it are completed in sequence, and then the phase that you have called is executed. For example, you have called the install phase:
mvn install
In such cases, first the compile phase is executed, then the test phase is executed, then the package phase is executed, and finally the install phase is executed.

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 and generates the EAR file at the location specified in the POM file.

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

test Runs BusinessEvents JUnit tests located in the BusinessEvents project (under the JavaSrc folder). The command searches for the BusinessEvents JUnit tests matches the following file names:
  • **/Test*.java
  • **/*Test.java
  • **/*TestCase.java
Note: Ensure that the EAR file location in the JUnit test suite file is same as the EAR file location specified in the POM file.
package Compiles the BusinessEvents project, generates the EAR file, and runs BusinessEvents JUnit tests located in the BusinessEvents project.
install Installs the BusinessEvents project EAR 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 remote repository, you must first build the project library at the location specified by the <projLibLocation> tag in the POM file.

Specify the remote repository details in the project's POM file and create $USER_HOME/.m2/settings.xml 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 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 till the install phase are executed 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>
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-base-image Builds the Docker image for TIBCO BusinessEvents. You can specify the following configurations that are required for the Docker image generation in the pom.xml file.
<baseImageConfig>
      <generateBaseImage>true</generateBaseImage>
      <useBEHome>true</useBEHome>
      <be_home/>
      <!-- Required Arguments -->
      <installers_location></installers_location>
      <edition></edition>
      <version></version>
      <image_version></image_version>
      <!-- Optional Arguments -->
      <addons></addons>
      <hf></hf>
      <as_hf></as_hf>
      <dockerfile></dockerfile>
</baseImageConfig>

This phase only executes if the <generateBaseImage> flag is set to true in pom.xml. You can skip this phase if the base image is already present and provide its details in the <appImageConfig> section for the build-app-docker-file phase.

Alternatively, to reduce the Docker image size for TIBCO BusinessEvents, set the <useBEHome> flag to true in pom.xml. The hotfixes for the TIBCO BusinessEvents and TIBCO ActiveSpaces must be installed on the same machine. You can use the optional arguments to specify their location. Specify the BusinessEvents software installation path in <be_home> tag. Also, specify Dockerfile.fromtar (included in the BusinessEvents software) in the <dockerfile> tag.
Note: Optimized image option only works on the Linux platform.

For more details about arguments required for Docker, see "Building the TIBCO BusinessEvents Docker Image" section in the TIBCO BusinessEvents Administration Guide.

build-app-docker-file Generates Dockerfile for the BusinessEvents application using the Docker image for TIBCO BusinessEvents. You can specify the following arguments that are required for the Dockerfile generation in the pom.xml file.
<appImageConfig>
     <cddFileLocation></cddFileLocation>
     <targetDir></targetDir>
     <baseBEImage></baseBEImage>
     <maintainer></maintainer>
     <email></email>
     <labels></labels>
     <appImage></appImage>
     <overwriteDockerfile></overwriteDockerfile>
</appImageConfig>

For more details on arguments required for Docker, see "Generating BusinessEvents Application Dockerfile" section in the TIBCO BusinessEvents Administration Guide.

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.
<appImageConfig>
     <targetDir></targetDir>
     <baseBEImage></baseBEImage>
     <appImage></appImage>
</appImageConfig>

For more details on arguments required for Docker, see "Building BusinessEvents Application Docker Image" section in the TIBCO BusinessEvents Administration Guide.

docker-install Executes all the earlier phases for Dockerfile and installs the BusinessEvents project EAR file into your Maven (.m2) repository.
docker-deploy Creates a tag for generated application image and deploys the tagged image to specified docker registry. All the previous phases are executed and then the docker-deploy phase is executed.
Note: For deploying to Amazon Web Services (AWS), you must have AWS Command Line Interface (CLI) installed and configured on 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.
<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>