Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

Continuous integration with Hudson

Open source CI server offers easy setup and configuration

  • Print
  • Feedback

Page 2 of 7

Supported SCMs

Hudson has integrated support for Subversion right out of the box, and only a small amount of configuration is required to integrate with CVS, assuming the CVS client is installed on the Hudson host. Several other source code management (SCM) solutions are supported in the form of Hudson plugins. At time of this writing, the following SCMs are supported:

  • Accurev
  • BitKeeper
  • ClearCase
  • Git
  • Mercurial
  • Perforce
  • StartTeam
  • Team Foundation Server
  • Visual SourceSafe
  • URL SCM (a special SCM plugin that allows the use of URLs for SCM)

In this article, I will be using Subversion and the source repository at Java.net, so you won't need to install any of these plugins. (As an aside, I know someone who is working on a MKS SourceIntegrity Hudson plugin. If you are interested in that, send me an email.)

Hudson is a free and open source product hosted at Java.net It was originally written by Kohsuke Kawaguchi, a staff engineer at Sun Microsystems, who announced its release on his blog in February of 2005. Hudson has since had approximately 154 releases.

Here are some of the reasons why I like Hudson, and why I would recommend it to you, barring any unusual requirements:

  • Of all the CI products I've used, it is by far the easiest to install and configure.
  • Its Web-based user interfaces are very friendly, intuitive, and responsive, in many cases providing immediate Ajax-enabled feedback on individual configuration fields.
  • Hudson is Java-based (which is useful if you're a Java developer) but is not limited to building Java-based software.
  • Hudson is cleanly componentized and offers a well-defined and documented extensibility API in the form of Hudson plugins. This has in turn led to a large library of Hudson plugins that extend the functionality of the server; these are freely available and installable from the Hudson console.

Installing Hudson: Windows XP or Ubuntu Linux

To use Hudson, you'll need an accessible and supported source control system (see the "Supported SCMs" sidebar for a listing), source that can be built into an artifact, and a working build script. Beyond that, all you really need to install and configure a working Hudson server is an installation of Java, version 1.5 or above, and the Hudson install file, which comes in the form of a Java EE Web archive (WAR). You can start the server very simply using the following command line:

C:\hudson> java -jar hudson.war

It is probably more common, however, to deploy Hudson onto a Java servlet container that is based on the Servlet 2.4 and JSP 2.0 specs, such as GlassFish, Tomcat, JBoss, or Jetty. In the next sections, I will walk you through two Hudson installation scenarios: one using Tomcat 6 on Windows XP, and another using JBoss 4.2.3 on Ubuntu Linux. (JBoss AS 5.0 was released after this article's submission date.)

Installing Hudson: Tomcat 6 and Windows XP

I will assume that you already have version 1.5 or higher of Java installed on your Windows XP machine. Following the steps below will install Tomcat 6.0.18 using the Windows Service Installer, so that Hudson starts immediately after Windows XP boots up and will run in the background even when no user is logged in. The download file for Tomcat is apache-tomcat-6.0.18.exe, which you should execute to begin the Tomcat install.

  • Print
  • Feedback

Resources

Downloads

  • Get the latest Hudson WAR file here or here.
  • Download apache-tomcat-6.0.18.exe to install Tomcat on your Windows machine. Download JBoss 4.2.3.GA for a Linux environment (look for the file named jboss-4.2.3.GA.zip).
  • Ant is the build tool used for examples in this article.
  • jboss-init.sh enables the automatic start and stop of the JBoss server.
  • If your Hudson server cannot connect to outside resources, you can download the plugins you need from the Hudson Website.

Learn more

More from JavaWorld