Hudson integration in NetBeans 6.7

Are you a Java developer and did you ever need to build your sources automatically? In this case, you must have already heard about Hudson... If you have used this tool, you must also know how great it is... But there is one more cool thing now (get ready to get excited:-)). We have integrated Hudson in the NetBeans IDE 6.7.

But first things first for those who are not in the picture yet....

Briefly about Hudson - automate your builds

Hudson is a tool for continuous integration (CI) written in Java that runs as a server. It allows you to create a task ("Hudson job"...) that is executed either manually, or when some condition is valid, or periodically (in a given schedule). This job can be for example an Ant task - Hudson can be used for periodic building.

Furthermore, the version control systems are very well integrated with the Hudson  -  you can have one computer with running Hudson instance and some other computer with the source code repository where you and your team commit the sources. (These are typically not the computers that are used by developers.)

Build is performed on the computer with running Hudson instance (slaves can be configured for more complex building but let's keep it simple for now) and it is performed with all committed changesets. This means the resulting build artifact is more representative than the one that programmer has on his/her computer (as the local sources can be outdated).

Sample of how the architecture can look:

Scheme of development architecture with Hudson

Hudson can be easily run on any computer with:

$ java -jar hudson.war 

This launches a server on localhost (port 8080 by default). Hudson and Hudson jobs are easily configurable via the web interface...

More information about the Hudson CI Tool are online.

Hudson and NetBeans - making it even simpler

Since NetBeans 6.7, the Hudson Builders node is present in the services. You can easily create and manage some properties of the Hudson job.

Hudson Builders - Services view

Before you can create a Hudson job from IDE, you need to do following:

  1. Download Hudson and run it on some machine that you have access to
    • ... so that you have a running Hudson instance ...
  2. You need to have your NetBeans project versioned either with SVN or Hg - install SVN/Hg on some other machine
    • ... so that the sources are on some well defined place ...
  3. Your project must have sharable libraries
    • ... so that the build can be performed - build cannot be successful if your project uses some libraries that Hudson does not have access to...
    • ... otherwise you cannot even to run JUnit tests remotely ("junit.jar" library is needed)...
    • Note: In order to make libraries sharable, open project properties, select "Libraries" section, click "Browse" button by the "Libraries Folder". Click "Next", click "Finish"...

Now how to create a Hudson job from the IDE:

  1. Register a Hudson instance in the IDE
    1. Open services view (Ctrl+4)
    2. Right-click the "Hudson Builders" node
    3. Invoke "Add Hudson Instance" action, fill in some alias for the instance and the URL
    4. Confirm the dialog - a new Hudson instance should be visible in the view (if there are some jobs on the instance, they are visible too)
  2. Create a new Hudson job (or "build"...)
    1. Right-click the Hudson instance you just added
    2. Invoke "New Build" action
    3. Fill in some alias for the build
    4. Browse for your NetBeans project
    5. Optionally, check what parts of the job should be performed (build Javadoc, run tests)
    6. Click the "Create" button - a new build will show up in the view
  3. Run the Hudson job
    1. Right-click the build you just created
    2. Invoke "Start job" action
    3. Expand the build's node - you will see a running instance of the job
    4. Right-click the running job and invoke console output - you can see the progress of the build that runs remotely (!) on the machine where the Hudson instance runs

How can you helps us?

Hudson integration is new in 6.7 and it definitely needs testing on various configurations. We are not able to test the Hudson integration in all scenarios - this is basically not technically possible. Your Hudson might use various authentication methods, your jobs can have specific configurations...

If you encounter any difficulties, you can submit an issue on the Hudson component and it will help us a lot (General: How do I file an issue?). You can provide a valuable feedback by writing comments on our mailing lists and forums. If you like the feature, help us to promote it, for example by writing some nice blog posts (if you intend to write an ugly one, please, file an issue first;-)) or by spreading the word.


I loved this feature. It rocks

Posted by atoms on June 22, 2009 at 03:56 AM PDT #

Its excellent...
I have been using netbeans from last 3 years and I was searching for CI tool.
And its available under netbeans6.7, really gr8

Posted by Dinesh Chothe on November 04, 2009 at 01:53 PM PST #


Posted by guest on May 18, 2010 at 11:06 PM PDT #

Wow...this was cool...I am using Netbeans 6.9.1, had some experience configuring Hudson, understanding of SVN. I was almost instantly able to configure CI using Hudson+SVN for a Maven 2 Java web app...everything I wanted for development...Thanks!!!

Posted by Vikram on September 24, 2010 at 04:45 AM PDT #

Those are great news, Vikram - happy to hear that! :)

Posted by Pere Dvorak on November 26, 2010 at 05:31 AM PST #

The NetBeans IDE 6.7 introduces integration with Project Kenai, a collaborative environment for developers to host open-source projects. The release also builds on the success of the NetBeans 6.5 with native support for Maven, integration of GlassFish and Hudson, and enhancements to Java, PHP, Ruby, Groovy and C/C++. Additional highlights of the 6.7 release include support for JavaScript 1.7 and the Java ME SDK 3.0.

Posted by Church Construction on April 16, 2011 at 01:01 AM PDT #

Post a Comment:
Comments are closed for this entry.

« June 2016