Hudson for CI - Tips, Tricks and insights

· Read in about 3 min · (430 words) ·

Just started using Hudson recently and I’m wowed! It’s head and shoulders above CruiseControl and things that I like a lot are

  1. Snappy web based config - felt great that I could set up a CI build with essentially the repo path alone

  2. Plugin system!

  3. Deep maven2 integration (though read on below that this isnt always what works)

  4. Trending data OOB - essentially giving you nice charts about how your build is doing over time

Now that I’ve said all the very nice things about it, here’s a few things that were hard to figure out/or weren’t immediately apparent. If your maven builds aggregates modules then you’ll find the experience a bit challenging

  1. The generated site doesnt work: Basically, the link is to one of the modules' site instead of a link to the parent project. This apparently is a known issue and the solution on hudson user list is to run the site:deploy goal and have a link in the project description to point to that url

  2. Code coverage: none of the coverage tools (EMMA, clover etc) support code coverage over a multi module build. Since coverage is very important to me, I eventually resorted to having separate build jobs instead of using the default multi module support. Here’s how my svn structure looks

/trunk/basebuild #contains the parent pom
/trunk/project1 # pom refers to ../basebuild/pom.xml
/trunk/project2 # ditto here

With the directory structure above, there are build jobs for project1 and project2. Each build job checks out both the project folder (/trunk/project1) and the basebuild folder so that the POM references work. One undesirable effect of this set up is that if project 2 depends on project 1, then project 1 build will have to install the artifact to the local repo for the project2 build to work. 3. Findbugs plugin - Running maven builds with findbugs configured did a Out of Memory (OOM) and failed the build. I tried setting MAVEN_OPTS to -Xmx512M at a bunch of places and nothing worked. Eventually, it turned out that the right place to specify it is in the Hudson COnfigure job page in the build section! 4. Violations plugin - This is a great little hudson plugin. However, I couldnt get this to work with a inherited POM setup above. Eventually resorted to using Findbugs and PMD hudson plugins individually.

I should mention that I’m running hudson 1.321 with the latest plugins. If you have any tips to share on running hudson - please do drop a link in the comments. Overall, a great big 'thank you' to the Hudson folks!