Skip to main content

Hudson plugin for WAR/EAR deployment / Cargo support in GlassFish

Posted by kohsuke on April 23, 2008 at 4:08 PM PDT

I recently wrote a plugin for Hudson that deploys a WAR/EAR to the appliation container. The typical intended use of this is that when you build a WAR on Hudson, you'd like to deploy it before commencing certain kind of testing.

I wanted this to be able to work with as many containers as possible, so I turned to Cargo for abstracting away the difference in how you carry out a deployment. This is a very useful project indeed, and one of a kind (I wish APIs like this were a part of some relevant JavaEE JSRs, but oh well.)

Anyway, I've contributed embedded Tomcat support in the past to Cargo, so I knew the project rather well (and BTW that would be great for anyone who wants to run tests, as embedding a servlet container enables you to capture all the output in one place, instead of splitting this between the server and the client — debugging will be a lot easier, too.)

When I initially did the Tomcat work, I also wanted to do the GlassFish support. Unfortunately, after I did a partial work (you can check out the code by "svn co"), I had to move on to do other things, and I was never able to come back.

And now I really want this feature, and there's some partial code in there. Would there be anyone interested in picking up the work and bring it to the completion? I'm a Cargo committer, so I think I should be able to sponsor the integration into the main Cargo source tree. And more importantly, the Cargo team seems to be interested in getting this feature. It's just that the current code has the following problems:

  1. It needs to satisfy the strict checkstyle rules of the Cargo project. They are very picky about whether a whitespace goes between 'if' and '(', whether '{' is on a new line, and so on.
  2. Integrate Cargo test cases to include GlassFish, which AIU is a requirement for code in the main Cargo source tree.

The optional bonus credit would be to support the remote container mode of Cargo. I'm sure it's not too hard to do that.

This could be an excellent candidate for the GlassFish Award Program. See more about this issue in JIRA at CARGO-491.

Related Topics >>


Any updates on Glassfish v3 support ?

Any updates on Glassfish v3 deployment support in Hudson with Cargo ?

richmolumby -- blog comment section is not a great place for issue tracking. Please file this as an issue in the issue tracker.

I noticed that Hudson only provides the ability to supply one war file to be deployed to tomcat. How do we handle Hudson jobs that require mulitple war files to be deployed for a single Husdon job? Please email response to: Thanks

ehsavoie -- maybe you should ping the dev list. In any project, sometimes things just fall through the cracks, and this might be one of them.

The real underlying issue, IMO, is that Cargo isn't truly modular. If it were discovering implementations through META-INF/services, then people can contribute container support without necessarily integrating things into the core. The way it stands right now, you have to hard code all the implementation class names in the core, hence everyone needs to be integrated into the project, and get stuck.

So I think *that* is the real issue. And I now remember that I filed that as CARGO-342.


Good news, Cargo is a useful project indeed. It would be nice to see as much as possible implementation. If you can do something for the JOnAS implementation (cf. CARGO-529 issue), it would be great.

And thanks a lot for the good work about hudson.


Hi, A friend of mine did the implementation for JOnAS (here but it was'nt integrated :(. I will talk to him about Glassfish. Emmanuel

Thank you for your answer. He will ping the dev list ;). Yep I agree that CARGO-342 is a real problem for extensibility :(.

This is good idea for all container owners, it may have some ...

This is good idea for all container owners, it may have some oppurtunity and chance to have quality deliveries in every cargo shipment. Nice work. Aztec storage containers