Meet Hudson

What is Hudson?

Hudson monitors executions of repeated jobs, such as building a software project or jobs run by cron. Among those things, current Hudson focuses on the following two jobs:

  1. Building/testing software projects continuously, just like CruiseControl or DamageControl. In a nutshell, Hudson provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity.
  2. Monitoring executions of externally-run jobs, such as cron jobs and procmail jobs, even those that are run on a remote machine. For example, with cron, all you receive is regular e-mails that capture the output, and it is up to you to look at them diligently and notice when it broke. Hudson keeps those outputs and makes it easy for you to notice when something is wrong.

Features

Hudson offers the following features:

  1. Easy installation: Just java -jar hudson.war, or deploy it in a servlet container. No additional install, no database.
  2. Easy configuration: Hudson can be configured entirely from its friendly web GUI with extensive on-the-fly error checks and inline help. There's no need to tweak XML manually anymore, although if you'd like to do so, you can do that, too.
  3. Change set support: Hudson can generate a list of changes made into the build from CVS/Subversion. This is also done in a fairly efficient fashion, to reduce the load on the repository.
  4. Permanent links: Hudson gives you clean readable URLs for most of its pages, including some permalinks like "latest build"/"latest successful build", so that they can be easily linked from elsewhere.
  5. RSS/E-mail/IM Integration: Monitor build results by RSS or e-mail to get real-time notifications on failures.
  6. After-the-fact tagging: Builds can be tagged long after builds are completed
  7. JUnit/TestNG test reporting: JUnit test reports can be tabulated, summarized, and displayed with history information, such as when it started breaking, etc. History trend is plotted into a graph.
  8. Distributed builds: Hudson can distribute build/test loads to multiple computers. This lets you get the most out of those idle workstations sitting beneath developers' desks.
  9. File fingerprinting: Hudson can keep track of which build produced which jars, and which build is using which version of jars, and so on. This works even for jars that are produced outside Hudson, and is ideal for projects to track dependency.
  10. Plugin Support: Hudson can be extended via 3rd party plugins. You can write plugins to make Hudson support tools/processes that your team uses.

Hudson Best Practices

Continuous Integration with automated test execution has seen broad adoption in recent years. The ideas behind Continuous Integration have changed how companies look at Build Management, Release Management, Deployment Automation, and Test Orchestration. This section provides a set of best practices for Hudson - A Continuous Integration Solution to provide executives, business managers, software developers and architects a better sense of the development progress and code quality of projects throughout the development lifecycle. (View Hudson Best Practices)

Introductory Articles

Test Drive

Launch Hudson through Java Web Start for a test drive. Once it launches, visit http://localhost:8080/ to get to the dashboard. Any configuration that you do with this Hudson will be stored in ~/.hudson, so your data will survive through Hudson process restart.

Installation

To run Hudson, minimally you need to have JRE 1.5 or later. After you download hudson.war, you can launch it by executing java -jar hudson.war. This is basically the same set up as the test drive, except that the output will go to console, not to a window.

Alternatively, if you have a servlet container that supports Servlet 2.4/JSP 2.0 or later, such as Glassfish, Tomcat 5, JBoss, Jetty 6, etc., then you can deploy hudson.war as you would any WAR file. See this document for more about container-specific installation instruction.

Once the war file is exploded, run chmod 755 hudson in the exploded hudson/WEB-INF directory so that you can execute this shell script.

If you're running on Windows you might want to run Hudson as a service so it starts up automatically without requiring a user to log in. One way is to first install Tomcat as a service and then deploy Hudson to it in the usual way.  Another way is to use the Java Service Wrapper. However, there may be problems using the service wrapper, because the Main class in Hudson in the default namespace conflicts with the service wrapper main class. Deploying inside a service container (Tomcat, Jetty, etc.) is probably more straightforward, even for developers without experience with such containers.

Also, see how other people are deploying Hudson to get some idea of how to make it fit your environment.

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Oct 29, 2007

    Anonymous says:

    Since this covers launching Hudson, and not just installing it. Why don't we giv...

    Since this covers launching Hudson, and not just installing it. Why don't we give a few of the more "key" command line parameters to use here. For example:

    • --httpPort=$HTTP_PORT
    • --javaHome=$JAVA_HOME

    And maybe a few others.

    Plus, a reminder that the command line parameters are not checked too carefully, so verify your spelling because if you misspell something, it will simply ignore that parameter.

  2. Dec 04, 2007

    Anonymous says:

    It would be useful to know more about the non-technical details of the projects ...

    It would be useful to know more about the non-technical details of the projects hudson has been used to build. For example, are the referenced projects 1, 10, 50, 100 or 1000 developers?

    I'm investigating using hudson to build 3-4 projects each with 30-40 developers. What kind of issues does this raise?

    Mathew Butler

    mathewbutler "at" yahoo "dot" com

  3. Dec 05, 2007

    Anonymous says:

    I find the Benefits section at best confusing, at worst alarming. Are you saying...

    I find the Benefits section at best confusing, at worst alarming. Are you saying that you commit code to source control when you have no idea if it passes unit tests or even builds on your own machine? Or does Hudson prevent anything from being committed to version control unless it first builds and tests, as TeamCity does?

    1. Dec 11, 2007

      Anonymous says:

      I think the benefits section is fine. I did not find it confusing when I was eva...

      I think the benefits section is fine. I did not find it confusing when I was evaluating Hudson. As the Benefits section suggests, you might not want to run all unit tests before committing, if you are fairly confident the code is OK and the tests take a long time to run.

      In answer to your question, out of the box Hudson does not prevent you from committing if the code does not compile or does not pass unit tests. You could create that kind of setup if you wanted.

      Hudson just polls your repository and then builds and reports. And its so easy to get set up. The Maven integration is good. That's why I use Hudson.

  4. Dec 21, 2007

    Anonymous says:

    I have a subverion repository which a master Makefile.  I put in  "mak...

    I have a subverion repository which a master Makefile.  I put in  "make clean; make lib" in the 'Execute Shell' parameters, but whenever I try to build, it says "No rules to make clean."  Anyone know how I can configure hudson to run make commands?

  5. Apr 01, 2009

    Ross aribi says:

    I'm a bit annoyed. I've installed Hudson on JBOSS and it has been working fine f...

    I'm a bit annoyed. I've installed Hudson on JBOSS and it has been working fine for weeks now. It's installed on Linux VM. Yesterday, for some reason, I got this Error: message when I started hudson:

    java.lang.VerifyError: class hudson.plugins.disk_usage.DiskUsageThread overrides final method .
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at hudson.plugins.disk_usage.DiskUsagePlugin.(DiskUsagePlugin.java:28)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:190)
    at hudson.PluginManager.(PluginManager.java:141)
    at hudson.model.Hudson.(Hudson.java:512)
    at hudson.WebAppMain$2.run(WebAppMain.java:190)

    My diskspace is fine:

    # df -k .
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sda2             25537752   2334292  21906212  10% /

    The log does not give me much to work with. Any idea what might have gone wrong?

    1. Oct 08

      Yauhen Artsiukhou says:

      Seems you're using Disk Usage Plugin. It requires JDK 1.6 as I know. What is you...

      Seems you're using Disk Usage Plugin. It requires JDK 1.6 as I know.
      What is your JDK version?

  6. Apr 17, 2009

    Nandini Obhrai says:

    hi, Can someone tell me how to setup hudson, such that it runs the ant.bat from...

    hi,

    Can someone tell me how to setup hudson, such that it runs the ant.bat from the workspace directory. Currently my build.xml is not found ant is being run from the c:\

    [build] $ cmd.exe /C '"D:\devtools\apache-ant-1.7.1\bin\ant.bat -file build.xml make && exit %%ERRORLEVEL%%"'

    resulting in the following error, as build.xml is actually in C:\Documents and Settings\useir\.hudson\jobs\ASYNC_BATCH_H\workspace

    C:\>"D:\devtools\Java\jdk1.5.0_17\bin\java.exe"  -classpath "D:\devtools\apache-ant-1.7.1\lib\ant-launcher.jar" "-Dant.home=D:\devtools\apache-ant-1.7.1" org.apache.tools.ant.launch.Launcher  -file build.xml make
    Buildfile: build.xml does not exist!
    Build failed

    Thanks!

    1. Jul 23, 2009

      Raghavendra K Neelekani says:

      U have to keep the build.xml file in the directory from which u r running ant......

      U have to keep the build.xml file in the directory from which u r running ant....

  7. Jul 23, 2009

    Raghavendra K Neelekani says:

    I have setup hudson server in my system and created new job..  After the jo...

    I have setup hudson server in my system and created new job..  After the job configuration when I save it , Its displaying the following message .. Job is not created..

    Status Code: 400

    Exception: This page expects a form submission
    Stacktrace: (none)
     
    can u people help me out please to resolve this problem ????

  8. yesterday at 04:16 AM

    sanjeev nair says:

    There seems to be a some issues with v1.344.A few things that were working befor...

    There seems to be a some issues with v1.344.A few things that were working before in v1.343 have stopped working now. Have listed down a few

    a. I used to click on the progress bar of the build number to display real time logs. Nothing happens when I click it

    b. The log file itself is not properly displayed. You need to select the "raw" log format option to view the log as text

    c. cant seem to configure a project getting the below error

    Status Code: 400

    Exception: This page expects a form submission
    Stacktrace: (none)

    Do we have a roll back option? Unfortunately.. I do not seem to have a v1.343 backup, but I do have the v1.342 backup. Any suggestions?

    Hudson server is installed on Windows 2003 server