Translate

July 30, 2013

Auto build PrimeFaces from source with Bamboo

How to use the latest version of PrimeFaces in your projects

Building from source in Bamboo

Background

A little while back, we wanted to use the latest version of Primefaces where some bugs where fixed but the built library was not available so we decided to build from source. It is quite easy to do manually but we wanted to automate the process. So what we did was to add a build in our CI: Bamboo. We have an internal maven repository (Nexus).
We want to be able to add PrimeFaces SNAPSHOTS to our projects

Original setup

We have Nexus installed and it is defined in our settings.xml so we can access our own builds. In addition, we have a Bamboo server (this setup should work with other CI).

Requirement

On the Bamboo server, you need to have perl installed and added as an executable in the Bamboo admin

The build

  1. You need to define the repository. For now, it is http://primefaces.googlecode.com/svn/primefaces/trunk/ I add it as a shared repository in Bamboo but it is not necessary. You can define it in the plan.
  2. Add the checkout task - no special configuration here
  3. Here is the trick: we need to replace the distributionManagement tag to deploy it to our own repository. This is done with perl. Create a "Command" task with the perl executable and add these argiment: -pi -e 'BEGIN{undef $/;} s/.*<\/distributionManagement>/your-distributionManagement-tag-goes-here/smg' pom.xml
    Note that all forward slash "/" needs to be escaped with a backslah i.e: http:\/\/www.repo.com\/path\/to\/repo
  4. Next, you create a maven task that runs clean deploy

That's it

Now you are ready to go with the newest PrimeFaces available in your projects. As a side note, I added a trigger to run this plan every week only if new code has been commited.

For more information

You can contact us at OSnode.

No comments:

Post a Comment