Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » integrating maven2 artifacts into RCP applications?
integrating maven2 artifacts into RCP applications? [message #536472] Fri, 28 May 2010 12:08 Go to next message
Kristian Rink is currently offline Kristian RinkFriend
Messages: 36
Registered: July 2009
Member
Folks;

for one of our use cases we're about to build an Eclipse RCP/RAP
application which is supposed to work with our existing Java backend
system. The backend system uses Spring and its support for Hessian
remoting in order to communicate, and the Spring apps are deployed
as .war files. I do have an ".api" maven artifact which contains most
of my service interfaces and base entities and I want this to be used
inside the RCP application as well, for obvious reasons.

Bad thing, however, is that so far we failed to completely use maven2
for building both the RCP and the RAP application, so by now I am
searching for a painless way of integrating the maven2 ".api" artifact
into the RCP build environment...

So far, I use m2eclipse and a "wrapper" m2 bundle in my workspace that
collects the .api and hessian, builds a huge jar-with-dependencies from
that, which by then I use inside a "plugin project from existing jars".
Drawback, however, is that as the .api also is still growing, I
frequently need to rebuild this, ending up with building all the maven2
stuff, building the m2 wrapper module inside Eclipse, copying the large
jar (api+dependencies) from the m2 wrapper to the "plugin from existing
jars" and eventually tweak the "exported packages" in there.

This thoroughly sucks as it is hard to explain, hard to manage, hard to
understand two days later. I wonder whether there is an easier, less
painful way how to integrate maven2 managed code into an Eclipse RCP
build?

TIA and all the best,
Kristian
Re: integrating maven2 artifacts into RCP applications? [message #536638 is a reply to message #536472] Sat, 29 May 2010 05:16 Go to previous messageGo to next message
Patrick Roumanoff is currently offline Patrick RoumanoffFriend
Messages: 19
Registered: July 2009
Junior Member
There is an upcoming plugin for maven 3 called tycho developed by the maven guys. But this doesn't solve your problem since it is to build eclipse plug-in not to bridge the gap between a jar approach and an osgi approrach.

you can find more information @ http://tycho.sonatype.org/

in my experience, using spring remoting for rcp apps can be done in many ways.

The option 1 is the one you are currently using, having a massive "Dependencies" bundle that includes everything that is needed to make spring remoting works.

Option 2 would be to split static dependencies (the one which are not chaning very often, like spring) and the wrapper plugin you are using for your .api jar

option 3 would be to make your .api jar a bundle itself as part of the standard build. since you control the build of this jar , why not make it a bundle to start with? all you need to do is add the proper MANIFEST.MF to it, you can either do that "Manually" by including the file in the jar as part of the resources, of use maven-bundle-plugin from the apache felix project. That is how Apache Directory studio is building its plugin with maven. But there is a large number of ways to achieve this, like the bundlor plugin.

Option 4 would be to use Spring DM that would allow you to leverage osgi services to expose the your remote API, with spring DM, each bundle as its own application context and they be wired together. Spring also expose a maven repository which contains "bundle-ified" jars @ http://www.springsource.com/repository/app/

So before you can choose how to integrate your maven dependencies in an RCP app, you need to choose which osgi pattern you want to implement.

cheers,
p.
Re: integrating maven2 artifacts into RCP applications? [message #539245 is a reply to message #536638] Thu, 10 June 2010 07:09 Go to previous message
Kristian Rink is currently offline Kristian RinkFriend
Messages: 36
Registered: July 2009
Member
Patrick;

and first off (though late), thanks a bunch for your response.

Am Sat, 29 May 2010 01:16:46 -0400
schrieb Patrick Roumanoff <patrick@roumanoff.com>:

> There is an upcoming plugin for maven 3 called tycho developed by the
> maven guys. But this doesn't solve your problem since it is to build
> eclipse plug-in not to bridge the gap between a jar approach and an
> osgi approrach.

Well, after looking closer into things, I see I can even leave out
Spring in the OSGi application and just use Hessian as a dependency
which would do well as a single bundle, same as commons-* (which is
already there).

So by now, all I eventually would need to do would be being capable of
treating my -api module (so far a maven2 project) as an "Eclipse plug-in
project" / bundle in Eclipse, as well. Is there some way to, say, make
a project using a maven2 folder layout for sources and targets also
behave like an Eclipse plug-in project (i.e. having plugin.xml,
MANIFEST.MF and friends in place)? I don't really need to build things
in both maven and Eclipse at the same time, I just want to share the
same API sources between the backend and the frontend project...

Thanks loads for your inspirations and all the best,
Kristian
Previous Topic:Keyboard shortcuts for common navigator
Next Topic:Changing property values in property view
Goto Forum:
  


Current Time: Thu Apr 25 22:56:09 GMT 2024

Powered by FUDForum. Page generated in 0.03463 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top