Skip to main content


Posted by ramapulavarthi on May 15, 2008 at 2:24 PM PDT

Kohsuke and I talked about "Improving the Engineering Process Through Automation by Hudson" at JavaOne last week. Kohsuke talked about Continous Integration, best practices with larger deployments of Hudson and extensibility features in Hudson. I showed the demo of some of the features of Hudson.

The demo has two parts. In the first part, the focus was on the ease of installation and using Hudson.
We showed that Hudson can be installed by doing "java -jar hudson.war" and it needs no container setup
or database configuration to get started. Later showed the WEB UI for manging hudson and creating new jobs.
The configuration in Hudson is very intuitive with inline help for all the configuration parameters and on the fly error checking.
This is very handy where we don't have to wait until the build fails to realize its because of a silly typo.

First, I created a "FreeStyle Job" which checks out sources from a subversion repository and runs ant to build the project and run some tests.
Later configured the job to archive the artifacts generated by that project and report Javadoc and Junit results. The Junit reporting feature in Hudson is very nice that it gives additinal information than it is there in your Junit reports. It offers easier navigation to reports of tests across different builds and keeps track of the age of test failures and plots trends with various builds etc.

Configuring the build to run periodically is very easy with hudson. It uses Cron-like syntax to set it to run whenever you want it. It can also monitor the SCM changes so that it can run automatically when ever somebody makes change to the sources instead of running periodically. This was shown in the demo by configuring to poll the subversion every minute for changes. I set up a mail server on my macbook to show that Hudson can send email notifications of the build status.

Later, I showed the newly introduced Maven2 project. Hudson has nice integration with Maven2 where it parses the POMs in your project and monitors the goals you run to execute some routine housekeeping you do with normal hudson job. For example, when you run "test" phase , it automatically records the Junit Reports and archives the artifacts. With this Maven2 Project feature, you need to do very little configuration to setup the job like hooking up the sources and invoking Maven to execute some goals.

In the second part, We showed the distributed build setup and Multi-Configuration Job(Matrix job). Adding slaves to the Master Hudson requires running hudson slave agent on the slave computer. It is as easy as clicking a Java Web Start link from the slave computer thats being hooked up.
Of course, you can use other mechanisms like SSH to run the slave agent on the slave computer. Later we showed creating Multi- Configuration Job where the project tests are run in different configurations. The Multi Configuration job can be very handy when you need to build something for different platforms or run tests with different configurations (like different containers, different JDKs, different databases etc.). You don't need to create a separate job for each configuration. Just create a Multiconfiguration job to instruct hudson to run in all the combinations of the parameters in parallel. Hudson not only runs the jobs in all the configurations in parallel but also aggregates the artifacts and reports from all the builds and shows in a nice matrix for easier comprehension. We did n't get enough time to show this feature completely in the session.

The response from the audience was great and they liked the features of Hudson and the value it brings in. I am planning to create some screencasts of these demos and some other useful features like build promotion and put it on Hudson wiki.

Go get Hudson and give it a try. Another important thing is that when you try Hudson, also look at the growing list of Hudson Plugins to work with various build systems, SCMs, notification mechanisms etc that complement the common core features in Hudson.


Rama, this Multi-configuration feature is very nice. We will be mostly using this in Grid, I will contact you more. This is Great!