Configuring TIBCO BW 6.x to work with Maven

Once again we are here to show you one new features that have been give to the fresh released TIBCO BW versiones (version 6.2) to improve our productivity and to allow us to integrate with so many developments done in the last few years. This new feature is the maven support!

It is out of the scope of this article to explain you a deepn insights the Maven capabilities or features, and I encourange you to check these links to increase your knowledge about it:

In a few words we can say that Maven is the new standard tool inside the Java developrment to build and resolve external dependencies in a declarative way with any problems for the development. It allows too the intregration with third-party apps like Continuous integration tools like Jenkins or Banshee, or with QA tools like Sonar, Checkstyle, Firebug, etc.

It’s an Apache software project and in their own words this is the definition of maven:

Maven’s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that Maven attempts to deal with: Making the build process easy,Providing a uniform build system,Providing quality project information, Providing guidelines for best practices development, Allowing transparent migration to new features.

As we said earlier the maven support is one of the new features that are released in this last version of the Business Works tool, but this feature was not released with so fully-integration but like a ‘build-it-yourself’ tool that is under your own risk to activitate. This is probably because it is not mature enough to make it the default way to handle the new BW project but something is clear. This will be the way you are going to handle your BW 6.x project for the next years, so you should get used to it as quick as posible.

In this article we are going to assume that you already have your maven binaries installed an properly configured in your system. If you don’t know how to do this, you can follow this tutorial:

So, we are going to start from this situation, if we write the command ‘mvn’ in the console window we have to get some message similar to this:

maven-1

Ok, so if you are getting to this point, we are ready to go for it. So, let’s start!

We launch the TIBCO Business Studio as a new normal day but this time we are getting a closer look to the samples panel that it is in the left-bottom side of the studio. If you expand the plugins folderm you can see a folder named Maven, and there it is everything we need to go ahead.

maven-2

And for now on we are going to follow the instructions inside the Readme.txt:

  1. We go to the bin folder for our TIBCO_HOME bw folder (<TIBCO_HOME>/bw/6.2/bin) and execute the command: bwinstall bw6-plugin-maven. If everything was OK, you will get a final message similar to this:

maven-3

2.- Now, we relaunch the TIBCO BusinessStudio and we can see like things are a little different right now. If you select a BW Project, you can see in the context menu a new option that says “Generate POM”, as you can see here:

maven-4

After doing the POM generation process, you can see like the BW Application icon have been changed and It is looking a little M in the left-upper corner. This way we are going to know which projects are using maven and which are not. You also can see the pom.xml file generate as the root file for any Maven development.

maven-5

And now you can start using your maven commands inside the Business Studio across the M2 Eclipse Plugin that is installed with this configuration or even from a CLI interface typing the commands yourself!

Advertisements

9 thoughts on “Configuring TIBCO BW 6.x to work with Maven

  1. Hi Slobodanka Vlashkovich,

    I am having the same issue as you mentioned in your post. I couldnt see Maven “Run As” utility.
    How do you resolve this problem?

    I have added %MAVEN_HOME% and %MAVEN_HOME%/bin into my Path variable.

    Also, where you look for error. Location of the file.

    Thanks.
    Regards,
    Tanvir

  2. Hello.

    After exec. the Generate POM option in Studio, from logs I can see fllowing:
    !MESSAGE Nature does not exist: org.eclipse.m2e.core.maven2Nature.

    note: POM .xml is getting created, but there is no Maven ‘Run as’ possibility afterwards.

    Also, project is not getting the M mentioned related to the app/module icons.

      • Good morning.

        There are no screen shots since in Studio happens nothing.
        The error above I took from the workspace logs.

        Nevertheless, I have found the issue in meantime.
        Problem was that in system vars I added directly the path of the Maven bin in to ‘Path’ instead of referencing it as ‘%%’ while is defined previously.

        I’ve reinstalled the plugin afterwards via the bwinstall and the initial Maven problem was gone.

        I would like to ask once again, if you have information if there is a posibility of uninstall of plugins?

        Thank you.
        Slobodanka

  3. Hi!
    Thanks for the great tutorial.
    I tried it but get an error when I invoke Maven to build the project. I have a main project (main pom file) with two modules. The first module seems to build fine but when it tries to build the second module I get an error:

    [INFO] Computing target platform for MavenProject: com.tibco.bw:BW_TestData.module:1.0.0-SNAPSHOT @ /home/tibco/.jenkins/jobs/TestCrewCom/workspace/BW_TestData.module/pom.xml
    [INFO] Resolving dependencies of MavenProject: com.tibco.bw:BW_TestData.module:1.0.0-SNAPSHOT @ /home/tibco/.jenkins/jobs/TestCrewCom/workspace/BW_TestData.module/pom.xml
    [INFO] Resolving class path of MavenProject: com.tibco.bw:BW_TestData.module:1.0.0-SNAPSHOT @ /home/tibco/.jenkins/jobs/TestCrewCom/workspace/BW_TestData_v1.module/pom.xml
    [ERROR] Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle BW_Resolve_TestData.module cannot be resolved
    [ERROR] Resolution errors:
    [ERROR] Bundle BW_TestData.module – Missing Constraint: Require-Capability: com.tibco.bw.palette; filter=”(name=bw.ftp)”
    [ERROR] -> [Help 1]
    org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle BW_TestData.module cannot be resolved
    Resolution errors:
    Bundle BW_TestData.module – Missing Constraint: Require-Capability: com.tibco.bw.palette; filter=”(name=bw.ftp)”

    Do you have any idea what’s wrong and how it can be solved?

    • With the information you provied We cannot say for sure the cause of the problem. Could you send to us the source code of the project so we can test it inside our facilities? Thanks!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s