Sunday, February 07, 2010

Cowley - A Hudson plugin for RTC (v.1.0.0) - Part 2 - IBM, meet Maven

Introduction
In my previous post, I introduced version 1.0.0 of Cowley, a Hudson plugin for IBM's Rational Team Concert (RTC) SCM system. I'd love for the plugin to be a simple one-click install like many others in the ecosystem, but unfortunately it currently relies on the RTC Build System Toolkit which is freely available, but isn't in any public Maven repositories. This means, in order to simply use the plugin, or to build it from source, you need to do a little Maven / Ant / Jar magic. This post in the series will tell you how.

Note: This post is specifically geared towards getting the required pieces of the Build Toolkit into a Maven-usable state. However, there is nothing here which couldn't be taken and reused in many other circumstances.

Pre-Requisites
I'm assuming for the rest of the instructions that you have Java 1.6 and Maven 2.x installed. If not, why not? Get to it!

Obtaining the RTC Build System Toolkit
Job 1 is to get the Jazz RTC Build System Toolkit. You can download it from jazz.net (Windows) (Linux) (registration required).

NOTE: The rest of the instructions are based on the Windows version of the toolkit. I guess, as its all Java based, it's really similar. Post comments on this blog if there is additional info I need to add here.

Once you have the Build System Toolkit downloaded, unzip it somewhere temporary.

The Maven / Ant / Jar Magic
Next you need to get all the jars which come with the IBM Toolkit, wrap them up as a single jar, and add it to Maven for quick access and reuse. To do this, you'll need the following maven pom.xml. Cut and paste it into a file for use.

Now if you create a directory, put this new pom.xml file into it, edit the property "rtc.build.toolkit.plugins.dir" property and run the "mvn install" command. This will get the maven plugins and dependencies required, create your uber-jar, and "install" (i.e. copy) it into your local maven repository.

Congratulations!
You now have the required elements of the RTC Build Toolkit installed in maven, ready to either be added direct to your Hudson install to enable your Cowley plugin, or so you can compile my RTC Proxy API from source.

Either way, look out for the later posts in this series to find out how to obtain and use the Cowley Plugin without looking at any more code, as well as the gory details of the plugin development (if you're feeling sadistic).

6 comments:

Trangy & Lukey said...

Great work. I'd love to use the cowley plugin but I can't find it.

Where can I get the cowley plugin from? On http://kenai.com/projects/cowley/pages/Home I can find the download for jazz-proxy-common, but not for the hudson plugin.

I found some cowley code on http://code.google.com/p/cowley/ but this seems very out of date.

Can anyone point me to where the cowley plugin is?

Trangy & Lukey said...

I've found jazz-proxy-common at http://kenai.com/projects/cowley/pages/Home, but where is the cowley plugin?

Andrew Law said...

HI Trangey and Lukey,

Apologies for that (and the lengthy time between question and response). I got waylaid putting the rest of the code up there. It's there now however, as well as some instructions on how to get things set up and running.

Hopefully this works for you. Please provide more feedback if you have any.

Cheers, Andrew

Anonymous said...

Hi,

I´m trying to configure the Hudson plugin, but for every URL that I configure in "Repository URL" the following error occurs :


ERROR: The parameter "teamRepository" must not be null.
java.lang.IllegalArgumentException: The parameter "teamRepository" must not be null.


Any tips???

Thanks in advance

Unknown said...

Else we can use RTC jazz + Mave + Hudson, but i got a stupid question... in this case, maven still be the building tool, but with a new depency (ANT tool)... Sorry im new in this tecnology.

Andrew Law said...

Hi Julian,

You're right. This is quite a messy way of doing it. I've now tidied this up significantly (removing Ant altogether) and blogged about it here: http://the-music-of-time.blogspot.com/2010/10/hudson-and-rtc-cowley-101-released.html

There is also a first release of the Cowley Hudson plugin available too.