by Lars Vogel

Follow me on twitter

Lars Vogel on Google+

Continuous Integration with Hudson - Tutorial

Lars Vogel

Version 0.5

02.02.2010

Revision History
Revision 0.1 27.12.2008 Lars
Vogel
First draft of article
Revision 0.2 26.02.2009 Lars
Vogel
Continued the work
Revision 0.4 01.02.2010 Lars
Vogel
Continued the work
Revision 0.5 02.02.2010 Lars
Vogel
Added SCM

Hudson

This article describes how to build a continuous integration cycle for Java development.

This article is currently in DRAFT.


Table of Contents

1. Continuous Integration with Hudson
1.1. Continuous Integration Overview
1.2. Hudson
1.3. Requirements for using Hudson
2. Installation
2.1. Apache Ant, Tomcat
2.2. Hudson
2.3. Configure Hudson
2.4. Using svn and Hudson behind a proxy
3. Version control systems
4. Setting up a Hudson job
5. Thank you
6. Questions and Discussion
7. Links and Literature
7.1. Source Code
7.2. Hudson links
7.3. PDE/Build links

1. Continuous Integration with Hudson

1.1. Continuous Integration Overview

Continuous integration is a process in which all development work is integrated at a predefined time or event and the resulting work is automatically tested and build. The idea is that development errors are identified very early in the process.

1.2. Hudson

Hudson is one open source tool to perform Continuous Integration. The basic functionality of Hudson is to monitor a SCM (Source Control System) and if changes occurs to start and monitor a build system (for example Apache Ant or Maven). Hudson will monitor the whole process and provide reporting functionality and notification functionality to report success or errors.

Hudson can be extended by additional plugins.

1.3. Requirements for using Hudson

To use Hudson you need:

  • An accessible source code repository, e.g. subversion, with your code checked in.

  • A working build script, e.g. ant script, checked into the respository

  • A webapplication server, e.g. Tomcat, to run Hudson

Tip

Hudson works also without webapplication server but I focus on the more common case.

2. Installation

2.1. Apache Ant, Tomcat

Install Tomcat. See Apache Tomcat Tutorial.

For the usage of Hudson you need to setup Apache Ant as a build tool. See Using Apache Ant for details.

2.2. Hudson

Download the "hudson.war" file from Hudson Homepage and put the it into your Tomcat "webapps" directory. If you start Tomcat your Hudson installation should be available under "http://localhost:8080/hudson/".

2.3. Configure Hudson

Before using hudson you need to tell it where your JDK and ant installation is. Go to Hudson under "http://localhost:8080/hudson/" and click "Manage Hudson" and then "Configure System"

Maintain the correct path to your JDK and Ant installation and press "Save" below.

2.4. Using svn and Hudson behind a proxy

See Hudson FAQ for a description how to configure the http proxy for svn in Hudson.

3. Version control systems

Hudson supports out of the box subversion and cvs but you find Hudson connectors for almost every SCM system.

The following will use svn as an example. You specify the svn URL during project setup.

4. Setting up a Hudson job

Select "New Job" and select "Freestyle Job".

Select "subversion" and maintain your svn URL. The system will give an error message that you need to maintain the credential. Click on the link and maintain your user and password.

5. Thank you

Please help me to support this article:

Flattr this

6. Questions and Discussion

Before posting questions, please see the vogella FAQ. If you have questions or find an error in this article please use the www.vogella.de Google Group. I have created a short list how to create good questions which might also help you.

7. Links and Literature

7.1. Source Code

http://www.vogella.de/code/codejava.html Source Code of Examples

7.2. Hudson links

https://hudson.dev.java.net/ Homepage of the Hudson continuous integration engine