Hudson is a slick, stable, and easy to install continuous integration environment. You’ll be using it in minutes. Honest.
Install Java
Hudson is a java webapp. Ubuntu comes with Sun’s JVM installed by default, so this is a no-op.
Download and Install Hudson
mkdir -p ~/.hudson cd ~/.hudson wget http://hudson-ci.org/latest/hudson.war java -jar ~/.hudson/hudson.war --httpPort=9000 &
You should see something like this:
Running from: /Users/mrm/.hudson/hudson.war [Winstone] - Beginning extraction from war file ... INFO: Completed initialization
If you don’t, you should check the documentation on the hudson wiki.
Create your first Hudson Job
Go to http://localhost:9000, and create a new “job” — jobs hold the build instructions for a project. They can be built from N build commands and N source code repositories, and have N final artifacts.
There are two main configuration items to concentrate on:
- where hudson should get your code, and
- how it should do a build.
The where is configured in the “Source Code Management” section. The how is configured in the “Build” section. You’ll want to click “Add build step” and choose the appropriate option.
Most likely you want it to rebuild your project whenever someone commits changes. If you aren’t familiar with cron, it might be a bit confusing. “*/5 * * * *” means poll every 5 minutes (whenever the minute value is evenly divisible by 5), like so:

Kudos to the developers!
Related posts:
- How to add a version number to your hudson-built maven jar
Maven’s jar plugin will automatically add a “pom.properties” in your jar’s META-INF/maven/$groupId/$artifactId directory. If you build with hudson, there are a number of other values that you might want to...... - How to increase maven heapspace in hudson builds
If your maven-built project fails in hudson (especially when you’re using the assembly plugin) and it isn’t a compile or test failure, check the console output. If it says “java.lang.OutOfMemoryError:...... - How to set up your Maven2 POM to support Java5
Seeing this? [bash highlight="3,4"] $ mvn compile … generics are not supported in -source 1.3 (try -source 1.5 to enable generics) [/bash] You need to tell the maven-compiler-plugin to use...... - How to add a version number to your maven webapp
I couldn’t find a simple recipe to add a version number to a maven-built webapp. The maven-war-plugin talks about how to filter, but no simple example is given. So. I’ll......