Saturday, January 15, 2011

Compling Hudson plug-ins..

While trying to debug this issue with the Git plug-in for Hudson, I had to download the source code package and try to compile it to create my own custom plug-in. There isn't a very good HOWTO out there to install Hudson plug-ins in Ubuntu, so I'll outline them here.

First, you need to have the Sun (or now Oracle) Java version, not the OpenJDK version that comes with Ubuntu. Hudson appears to have dependencies on some sun.com libraries, so it's best to replace it with the Sun version. You also have to be wary of the fact that Ubuntu may have the OpenJDK installed already, so to ensure you're running the right version, I basically did an apt-get remove openjdk-jdk and openjdk-6-jre first before following these steps (JDK is needed).

http://hustoknow.blogspot.com/2010/09/installing-java-on-ubuntu-1004.html

Next, you need Maven2, which is the package management system for Java. One thing I did notice is that downloads are horrendously slow with the native /etc/maven2/settings.xml but renaming it helped solve the issue. Then I did a git clone of the Hudson-GIT-plugin code (Maven will install the Hudson core source code), and then copied the dotm2_settings.xml.

1. sudo apt-get install maven2
2. sudo mv /etc/maven2/settings.xml /etc/maven2/settings.xml.orig
3. git clone https://github.com/hudson/Hudson-GIT-plugin.git
4. cd Hudson-GIT-plugin
5. mvn compile
5. cp dotme_settings.xml ~/.m2/settings.xml)

These steps, after watching Maven download a large number of files, appeared to allow me to compile the Hudson Git plug-in.

No comments:

Post a Comment