Monday, April 23

Quick OSGi projects using Maven archetypes

Have you ever wanted to try OSGi, but found setting up the build and working out the manifest too much of a chore?

If so then help is at hand - over the last few months, I have been developing a set of Maven archetypes and plugins to automate much of the manual work required in creating an OSGi project. Recently I also provided Windows batch files and Linux shell scripts to make it even easier:

http://wiki.ops4j.org/confluence/display/ops4j/Pax+Construct

All you need is Maven2 and a Java5 runtime - the best part is the OSGi manifest attributes are automatically calculated for you by Peter Krien's wonderful bnd tool, connected to Maven by the maven-bundle-plugin from the Apache Felix project.

For example, the following commands would create a simple skeleton OSGi web application ... and deploy it to Equinox:


pax-create-project -g simple.project -a osgi-web-app

cd osgi-web-app

mvn install

pax-wrap-jar -g javax.servlet -a servlet-api -v 2.5
pax-import-bundle -g org.ops4j.pax.logging -a api -v 0.9.4
pax-import-bundle -g org.ops4j.pax.logging -a jcl -v 0.9.4
pax-import-bundle -g org.ops4j.pax.logging -a slf4j -v 0.9.4
pax-import-bundle -g org.ungoverned.osgi.bundle -a http -v 1.1.2
pax-create-bundle -p my.osgi.code.myBundle -n myBundle

mvn install pax:provision


all you need to add is the internal application code ;)

Tuesday, February 27

Bali 2007


Photos of our recent trip to Bali - we set off on Valentine's day (along with Hayfa's parents) to Jimbaran in the south of Bali, and spent most of our trip enjoying the culture and scenery around Ubud. Had a really good time - many thanks to Pak Gusti for showing us round!

Saturday, February 10

My new macbook

I've always wanted to try out a mac, and the recent batch of Intel Core 2 Duo macbooks really caught my eye. However, I managed to resist the temptation last year ... as my wife Hayfa kept reminding me, we didn't need more computers cluttering up the house (we already have a dell laptop and an AMD64 desktop that I built in the UK).

Anyway, recently I moved to a new job (working on OSGi stuff) and this triggered a new bout of window ...err... mac-browsing. I'd been looking at the 2GHz mid-range model, but it wasn't in stock in KL. Then one weekend when Hayfa was in Penang (funny how I buy these things when my sayang isn't around) I saw an advert for MacCity in Cineleisure - RM3999 for the basic model for the first 10 customers between 3 and 5pm, a saving of RM400!

So I drove to Cineleisure, parked, wandered over to the store just before 3pm, mulled things over a bit, decided to queue and got the next-to-last one!



I'm very happy with my macbook - didn't take long to get used to the single mouse button (even starts to make sense!) and the mac command key. Even happier once I got fink and iTerm installed - in fact, it's now replaced my development machine at work!

Hayfa was pleased with my purchase in the end, because we don't have to fight over using the dell while we sit on the coach ... and it didn't take long (I think under an hour) for her to 'persuade' me to add a login for her on the macbook :)

So... if anyone wants a dell, let me know ;)

Spring Flowers

A bargain at only RM16 from IKEA :)

Friday, February 9

I miss snow

My parents just sent me this photo of the view from their house, brrrr...

Monday, November 27

Finally ... photos from our trip to Indonesia!

After promising and promising to upload the photos from our recent trip to Indonesia, my wife and I sat down this weekend and went through labelling and selecting images - here is the result of our efforts, enjoy!

Monday, November 13

Sun open sources Java under GPLv2

Amazing news ... Sun is going to release Java under the GPL! InfoQ has the full scoop at http://www.infoq.com/news/2006/11/open-source-java along with some interesting observations on whether classes extending a GPL'd java.lang.Object are a derivative work (thankfully they aren't - phew).

Monday, November 6

Selamat Hari Raya Idul Fitri 1427 H, Mohon Maaf Lahir Batin

Back from visiting Indonesia for Raya - we went to Padang and Bukittinggi in West Sumatra, where my mother-in-law's family live. My wife's lineage is Minangkabau, which is matrilineal, so when we have kids they'll also be Minang - how cool is that! Everyone was very friendly and interested to meet the new 'Inggeris' addition to the family. I learnt so many words in two weeks - much more than in Malaysia, mainly because not many people spoke english over there (older people can understand some dutch/german, as it used to be a dutch colony).

Food was fantastic, but oh-so-more spicy than I'm used to in KL. We had rice at every meal, even breakfast, along with various dishes like Rendang, Dendeng (like beef jerky with hot chili) and Cincang. We even managed to bring back some smoked eels, which smell horrible but taste great.

More to come later... hopefully with some photos!