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 6 of 7

  • name: JDK 1.6.0_07
  • JAVA_HOME:
    • Windows: C:\jdk1.6.0_07
    • Linux: /usr/lib/jvm/java-6-sun

If you're using Windows, you can simply download an Ant installation and unzip it into the target directory. On Ubuntu, you will use the following commands to install Ant:

sudo apt-get install ant
sudo apt-get install ant-optional
ant -version
Apache Ant version 1.7.0 compiled on August 29 2007

The Ubuntu installation will install Ant in /usr/share/ant.

Figure 11 displays the Ubuntu configuration for the JDK and Ant. When I tabbed out of the fields specifying the locations of the installs, the warnings disappeared. I also added a second instance of Ant, which is badly configured. In the figure, you can see that, if you enter a valid directory path that isn't actually the correct directory for the Ant instance, Hudson warns you that your entry does not appear to be correct. It will do this for both the JDK and Ant. I subsequently deleted this erroneous Ant entry, leaving only the valid one.

JDK and Ant configured under Ubuntu

Figure 11. JDK and Ant configured under Ubuntu

Further down in the same form, you will see a warning that Hudson cannot locate the CVS executable. If you are not using CVS, you can safely ignore this.

The last important entry on this page is the SMTP configuration, which allows Hudson to email you notifications of important events like failed builds. If your SMTP server requires authentication, you will need to use the advanced options. I use my Google Apps hosted domain, but if you have a valid Gmail account, you can use the Google SMTP server and your Gmail address. Figure 12 shows my Hudson server configuration for mail.

Configuring Hudson's SMTP forwarder using Google's mail server

Figure 12. Configuring Hudson's SMTP forwarder using Google's mail server

The basic system-level configuration is now complete. You're ready to move on to configuring a specific build job.

Configuring a build job in Hudson

On the main Hudson page at http://localhost:8080/Hudson, click the New Job link. Figure 13 illustrates the screen that will come up next; here, you assign a name to your new build job. There are several options for new job types, but for the scope of this article, you will focus on the type titled Build a free-style software project. The one other type I frequently use is Copy existing job; this comes in handy when I want to create a new job copied from an existing job.

New job name

Figure 13. New job name

In this case, I am going to set up a build job for my HeliosJMX project, stored in Subversion at java.net. I am going to build the source, which is hot and fresh right out of the trunk, so I will call the build job HeliosJMXTrunk. Once I enter that name, I click OK.

The next form that comes up is the bulk of the new job configuration, and it is quite long. The details of this configuration are listed below. On the right of each option on this form, there is a little question-mark (?) icon. Do not hesitate to click on it for a more detailed explanation of any configuration option. This will not drag you off to another page, losing your work in process; rather, it simply inserts the help text directly into the page, so using the Help is negligibly intrusive. Virtually all of this configuration is identical under both Windows and Linux.

  • 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