This chapter describes how to install and configure Hudson to automate the build process and how to integrate Hudson with Maven.
Before you install Hudson, you must meet the prerequistes.
Ensure that you have the following components of the continuous integration system configured before you begin installing Hudson:
Subversion server configured and running, as directed in Installing and Configuring Subversion for Version Control.
Archiva configured and running as directed in Installing and Configuring the Archiva Maven Repository Manager, which implies that you have an Oracle Fusion Middleware product installed in an Oracle home and have run the Oracle Maven Synchronization plug-in to populate Archiva.
JDK 1.6 or higher installed on the Hudson host.
Maven 3 installed on the Hudson host.
You can download Hudson either as a WAR file or as Linux RPMs.
The latest production version of Hudson can be downloaded directly from the following location:
Hudson is distributed in two distinct versions:
WAR file, which can either run as standalone or can be added to an existing application server installation.
Linux RPMs compiled for specific operating systems. Package management support in the form of appropriate repositories are available to install the RPM and necessary dependencies.
This document focuses on Oracle Linux and Windows installation. Details for the other operating systems may vary from these. For instructions on various types of installations, see
You can install Hudson on Linux or Windows.
On a Linux computer supporting YUM, run the following commands:
sudo wget -O /etc/yum.repos.d/hudson.repo http://hudson-ci.org/redhat/hudson.repo sudo yum check-update sudo yum install hudson
This installs Hudson as a daemon and creates a Hudson user. This user is used by the server to perform build job-related activities.
You must download the Hudson WAR distribution. Then, to install it:
Start Hudson in standalone mode by running the following command:
java -jar hudson-3.2.1.war
When Hudson starts:
Open the following URL in a web browser:
Navigate to Manage Hudson, then Install as Windows Service. This enables you to configure Hudson as a standard Windows service.
For instructions, see
If you are using a single host for your artifact repository and continuous integration server, you must change the HTTP port used by Hudson.
To change the HTTP port:
This value is located in the
/etc/sysconfig/hudson directory with
This value is located in the
You can start Hudson and monitor its logs.
To start Hudson:
If you have installed Hudson as a service, you can start the application by running the following command:
You can monitor start up by checking the logs in the following directory:
Run the following command to monitor logs:
tail -f /var/log/hudson/hudson.log
Start Hudson on Windows as a normal service:
Go to Control Panel.
Navigate to Administrative Tools, then Services.
Select the Hudson service and click Start.
Hudson logs are available in the following location:
After you install Hudson, you must take several steps to configure Maven to work with Hudson.
This section contains the following topics:
The first time you start Hudson, go to the home page to complete the installation:
http://localhost:8080(change the port if you modified it during installation).
The rest of the configuration in this section is continued from the Hudson home page and assumes that you are logged in.
You must configure the JDK that you intend to use for direct Java build configurations. To configure:
jdk1.7.0and add the complete path of your installed JDK.
You must specify the Maven 3 location so that Hudson knows where Maven is located. To do so:
To utilize Maven settings from Hudson, embed the settings.xml content into a settings object in Hudson's global Maven configuration:
/$HOME/.m2/settings.xml. Copy the contents into the large text field at the bottom of the page..
Oracle recommends that you replace any localhost URL references in the settings.xml with fully qualified domain names or IP addresses because Hudson builds can eventually occur on non-local build hosts.
Hudson jobs may require job-specific customizations of environment variables. Because Hudson does not support this by default, you must install an additional plug-in. To install the plug-in:
To configure automatic builds when changes are checked in, you must configure Hudson to monitor the artifact repository for SNAPSHOT deployment changes. Such changes trigger builds of affected components that have dependencies on the changed artifacts. To configure Hudson to monitor the artifact repository:
In addition to monitoring the artifact repository for updated dependencies, the continuous integration server must constantly check the source control system for updates and trigger project builds accordingly. Unlike repository monitoring, software configuration management monitoring must be uniquely configured per build configuration. As you create new build configurations, you must set the Subversion location information for the related project. For more information about setting the location information, see Automating the Build with Hudson.
Subversion support comes with the base Hudson distribution. Other source control systems may require separate Hudson plug-in installation.
This document is meant as a quick guide for starting and running Hudson and does not provide extensive detail on Hudson operations.
You can find the primary source of the official documentation on Hudson in the following location:
For new users, you can find introductory guides to Hudson in the following location:
The Hudson book is located in the following location: