Introduction to Mavenization

The Mavenization is the process that will convert an existing base of code not using this plugin to a fully Maven-enabled one. It implies basically to create and associate a POM (to mavenize) to every projects in the base of code.

Unintrusive

This process is not intrusive in the source code itself and can be reverted at any time (simply by removing the created POM).

Prerequisites

Before reading this chapter, the user should be familiar with the basic usage of the Maven Plugin for TIBCO BusinessWorks and have a correct “settings.xml” installed.

Steps

The steps of a classic Mavenization will be:

  • the creation of a client root POM, responsible for:

    • defining all the common configuration for the client project (inspired by corporate good practices and configuration habits)
  • the creation of POMs for all BW projects: all the BusinessWorks projects of the client project must have a POM. This is called mass Mavenization because there is potentially a huge number of BW projects. We will see in details that it implies to define explicitly in the POMs the dependencies which are (too) loosely defined by standard TIBCO BusinessWorks mechanism (aliases, .designtimelibs files, …).

Client Root creation

Disambiguation about “project”

Before going further please be aware that the term “project” can be ambiguous.

We can use “project” to define two different things:

  • a TIBCO BusinessWorks project

  • a full client project which is composed (but not only) by several TIBCO BusinessWorks projects

In this documentation the context will help to strip away the ambiguity. For instance client project and BusinessWorks project will often be used.

Why a root client project?

The idea to have a root client project is to define a common POM ancestor to all the BusinessWorks projects to mavenize.

There are several advantages:

  • as in classic Maven, you can manage the version of the Maven plugins (especially this one) and dependencies to use in all the BusinessWorks projects. The build will be more reliable. Moreover all projects can override the default setting of the root client project if needed.

  • this root client project can be used for the aggregation pattern. It is particularly useful for a client project when it comes to create delivery packages.

How to do?

There is a Maven archetype provided called archetype-client-root-project.

 mvn archetype:generate -DarchetypeGroupId=fr.fastconnect.factory.tibco.bw.maven \
                        -DarchetypeArtifactId=archetype-client-root-project \
                        -DgroupId=com.company.project \
                        -DartifactId=project-root \
                        -Dversion=1.0.0 \
                        -DclientProjectName=ABC \
                        -DfcFactoryParentVersion=2.4.1 \
                       [-DinteractiveMode=false]

Before using this archetype you might want to read the discussion about the use of FC TIBCO Factory root parent POM in a client root POM.

Mass Mavenization

Concept

The idea is to define a list of projects based on some criterias and to apply actions on the result list.

  • A good example of list can be: Find recursively all the BW projects in the directory “C:/workspace” whose name contains the “flow” keyword.

  • A good example of action to apply to the previous list can be: Add the “common-flow-utils” Projlib as a dependency to these projects.

This being said, the mass Mavenization of an existing client project is much easier as it can handle the simplest action (ex: create a basic POM for all my BW projects) and more complex ones (ex: add a dependency to some projects or add some projects as modules to package in a delivery archive).

To conclude on the concept we can say that it will not only create the required POMs for all the BusinessWorks projects but also allow to enrich these POMs to define advanced properties and patterns.

Listing all the projects to mavenize

The goal to use is list-bw-projects.

Creating POM for the projects in a list (basic mavenization)

The goal to use is mavenize-bw-projects

Back to top

Version: 2.4.1. Last Published: 2016-01-22.