Skip to main content

Ant, Hudson and Glassfish

Posted by n_varun on November 11, 2008 at 1:50 AM PST

Working on a project based on NetBeans Platform, never thought I would discover many new technologies!

Ant-Based Projects, NetBeans Build System

For the past 1 week or so, I am trying to learn how to create a new project type based on the layout I decide. So, thought of going for Ant Based Project Type, asked the mailing lists.

I was pointed to a document, here's an overview- "This guide should give developers of NetBeans modules (extensions) a basic idea of how to write new project types for NetBeans 4.x, as well as use certain important parts of the project and build system functionality from other kinds of modules." Read this document, referred the related javadocs and it was surely going to be time consuming. Still, I kept surfing and interlinking documents, so that everything falls into place & makes sense.


Lol, whenever I surf the web for understanding one technology, I found another! This goes for Hudson as well, during my above internet surfing on NetBeans Platform. I found out Hudson too, in an unusual manner. I had just heard the name, never knew what it does?

Recently, I saw Amit's blog and found out, he had reviewed Tom Wheeler's latest article. Although, topic was of no interest to me, I was more interested to know what other articles he has written for Object Computing, Inc.

Then, I found out Tom's article on "Automating Builds Made Easy with Hudson". It seems to be outdated as it was written 2 years back. Still, it had everything to give an introduction to Hudson technology for students like me!Nov 09, 2007

I thought of staying away from it for sometime, so as to focus on the above, i.e. creating Ant Based Project Type. However, it was not to be as on Sunday, I thought of trying out Hudson. Tom, thanks for the article, at least I could get started with it. Since Dec 2006, many changes might have taken place, and it was visible atleast in the Web UI of Hudson, so I downloaded Hudson 1.258 and deployed its ".war" file using Glassfish V2 UR2 (bundled with NetBeans IDE, early this year) and it had one "domain name" by default as "domain1". So, using CLI on Windows XP Professional SP2, I ran the following command-

asadmin start-domain domain1

Every time I had to run this to launch Glassfish server, so as to deploy Hudson and automate builds. So, I created a batch file (runGf.bat), which would run the above command. It might look silly to execute a single command from batch file, but its quite useful to me. Moreover, if there exists many domain names, then I can make the batch file more useful by passing the "domain name" as an argument. Here's the modified contents-

asadmin start-domain %1

It will look like this at Command Prompt;

C:/>runGf domain1

It does make sense, isn't it?


CI with Hudson on Glassfish

Tom Wheeler (NetBeans Dream Team Member),
Automated Builds Made Easy with Hudson

Related Links

Arguments handling in a batch file

Glassfish Quick Start Guide

Administering Hudson

Hudson and Glassfish

Related Topics >>