The last few days I've been experimenting with Hudson on OSGi - seeing what breaks, what can be split into bundles, and how plugins might work as OSGi bundles. At the moment I'm using the Eclipse Gemini-Web project to load and auto-convert the Hudson WAR into a Web Application Bundle (WAB) - part of the OSGi Enterprise Specification from http://www.osgi.org/download/r4v42/r4.enterprise.pdf
I can now get Hudson up and running with the following instructions:
2) Launch Equinox from the Gemini-Web setup using:
java "-Dorg.osgi.framework.bootdelegation=sun.*,com.apple.*" -jar org.eclipse.osgi_3.6.0.v20100517.jar -console
^ the bootdelegation setting is currently needed by XStream (expects to "sun.misc" to be visible) and JChart (needs to see the Apple LaF on OS X)
3) Install the Hudson WAR, which will be auto-converted by Gemini into an OSGi WAB... warning it can take a long time to convert because it's ~35mb!
osgi> install webbundle:file:/tmp/hudson.war?Web-ContextPath=hudson
^ the webbundle: protocol does the wrapping, and we manually set the context path (won't be necessary when we add the header to the original WAR)
4) Start the Hudson WAB:
Note: remote builds fail at the moment because hudson.remoting.Which.jarFile() currently doesn't know how to handle the "bundleresource:" URL protocol. I'm working on fixing that, then I'll move onto loading Hudson plugins as bundles which is where the real fun starts! Another interesting topic is how to slice Hudson into smaller bundles, which should speed things up (no need to convert the WAR). Having a selection of smaller bundles also means people could choose which features to install (ie. reduced footprint) and provide a way to patch individual components without having to update everything. The classic WAR would then be a merge/assembly of the individual bundles.