Eclipse RCP development meets Maven2 projects

Maven2 is surely a great solution for building web applications.

Direct and transitive dependencies are resolved automatically, packaging, testing, reporting, everything out of the box. On the rich client side we have a very similar solution when we use Eclipse RCP as application framework. The PDE – plugin development environment – solves similar problems, specially dependencies between plugins.

A very common technology scenario for web applications in our days is to build upon Spring/ Hibernate and some GUI-Web-Framework- Solution.

Based on this technologies, http remoting became very usual too. Well, it did not take long to have the first maven2/ pde conflict. Not having the time to make maven2 build eclipse plugins and not having time to build the needed eclipse plugin integrate maven2 dependencies natively, I searched for some other practical solution.

In the Maven2 world I have the following scenario:

In my RCP based rich client application I have similar dependency scenarios:

Well, building my maven artifacts – in this case beeing done by continuum – is quite easy. Building the rich client without foreign dependencies is very nice done through the PDE itself, but how do I get my cross-building-tool-dependencies managed?

I found ant to be the best solution in this special case. I created a pom.xml in my rich client project describing my dependencies to the maven world. Afterwards I used the maven ant tasks to read this pom, load all dependencies and flatten them into some libs directory in my rich client app. Manually adding this libraries to the plugin descriptor files through PDE is not that nice, it probably can be automated if we write some ant task to modify the manifest file.

I hope this helps other developers to adopt maven2 build system even if there is some Eclipse RCP development involved.

Have fun!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.