camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <>
Subject Re: How to do Source code attachments for camel osgi bundles in eclipse
Date Tue, 18 May 2010 21:44:22 GMT
I just found an eclipse project that could really help integrate maven 
and eclipse pde:



Am 18.05.2010 22:45, schrieb Christian Schneider:
> Hi Stephen,
> of course I started by trying to use maven for osgi. Outside of osgi I 
> really like the maven repository where almost anything you need is 
> readily available.
> The pomĀ“s do a really great job of documenting hiow the projects are 
> structured and help to standardize builds over many separate teams.
> In osgi I am mainly interested in doing Eclipse RCP user interfaces. 
> Doing this with maven is possible but quite a pain at least anytime I 
> tried it. When simply using the pde I can create a target platform from
> Eclipse that contains the necessary libs for user interfaces. Then 
> when I create the bundles in Eclipse they are automatically using 
> project dependencies so updates in a project are instantly visible in 
> other projects.
> Then when debugging I can simply select my main bundles and eclipse 
> resolves the dependencies. Even building the whole app is not that 
> difficult.
> When using maven the first problem is that there is no public repo 
> with all the eclipse gui and platform bundles (at least I did not find 
> one). So the first task is to get these into your maven repo. Then the 
> dependency management is much
> more complex as the way maven resolves dependencies does not match the 
> way osgi resolves dependencies. So you end up defining the poms by 
> hand which is much easier in pde. In pde you define an import of a 
> package that is not in your current dependencies and eclipse can 
> propose which bundle could match. In maven you have to know where it 
> is provided.
> Then when it comes to larger frameworks like camel or cxf it is quite 
> difficult to find the dependencies. Almost none are in maven central. 
> The dependencies in maven point to the non osgi versions of the libs. 
> So you have to fetch them from repos like spring source. There they 
> build only a subset of libs and repackage them in quite strange ways. 
> Some times you even have to repackage libs as bundles yourself. Of 
> course these last set of problems are commons whenn using maven or 
> pde. So they are rather a problem with the teams who develop the libs. 
> If they all would create nice bundles for maven central this would be 
> much easier.
> All in all I will be glad when my GUI builds run on maven again (like 
> with swing) but at the moment I was not yet succesful in making the 
> maven builds for GUIs as easy and usable as the pde builds. But I 
> would be glad to see pointers to a good tutorial how to build Eclipse 
> RCP GUIs with maven.
> Greetings
> Christian
> Am 18.05.2010 21:15, schrieb Stephen Gargan:
>> Christian,
>> Out of curiosity, what cool things does PDE give you that you'd not
>> want to switch? Is it to do with your osgi container? Karaf has
>> excellent integration with mvn (via pax). With it you can pull bundles
>> straight from your mvn repo straight into the running container.
>> Couple this with 'features', its mechanism for defining groups of
>> bundles and you have a really compelling platform.
>> There is no reason you couldn't get pax working with whatever
>> container you are using, but you get it for free with karaf and it
>> makes building and deploying bundles a snap.
>> You've no doubt checked, but in case you've missed seeing them, there
>> are a bunch of samples in the  camel examples (and the features
>> project under platform) that show how to build osgi bundles with
>> maven. You can then run your eclipse plugin to attach the sources.
>> Just a suggestion of course, but do check it out you might be
>> pleasantly suprised.
>> rgds,
>> ste
>> On Tue, May 18, 2010 at 11:46 AM, Christian Schneider
>> <>  wrote:
>>> Hi Stephen,
>>> for non osgi projects I also use maven and have no problem getting the
>>> sources. Currently I do not use maven for my osgi projects as the ide
>>> support is better when using the pde mode in eclipse.
>>> The only problem is that the source code is not attached this way.
>>> Greetings
>>> Christian
>>> Am 18.05.2010 18:19, schrieb Stephen Gargan:
>>>> if you run the eclipse plugin with the following flag it will download
>>>> the sources and attach them in the classpath.
>>>> mvn eclipse:eclipse -DdownloadSources=true
>>>> if you're in linux or use cygwin, add quick alias to 'me' and you
>>>> never need worry about it again.
>>>> alias me='mvn eclipse:eclipse -DdownloadSources=true'
>>>> If you're so inclined you can download the javadoc too, but usually
>>>> having the source is enough!
>>>> Here are a few more mvn aliases that I regularly use, you might get
>>>> some use out of them too.
>>>> mci='mvn clean install'
>>>> mcist='mvn clean install -Dmaven.test.skip=true'
>>>> mdt='mvn dependency:tree'
>>>> me='mvn eclipse:eclipse -DdownloadSources=true'
>>>> mep='mvn help:effective-pom'
>>>> mes='mvn help:effective-settings'
>>>> mag='mvn archetype:generate
>>>> -DarchetypeCatalog="internal,file:///opt/mf/repo/archetype-catalog.xml,,,,,,"

>>>> '
>>>> ste
>>>> On Tue, May 18, 2010 at 12:17 AM, Christian Schneider
>>>> <>    wrote:
>>>>> Hi all,
>>>>> while trying to get camel running in osgi I would like to be able to
>>>>> debug
>>>>> through the source code in eclipse. When I am not using osgi I 
>>>>> usually
>>>>> leave
>>>>> the task of attaching the source to maven which does a great job 
>>>>> here.
>>>>> For osgi I have set up a target platform where I copied the camel 
>>>>> jars
>>>>> and
>>>>> also the source jars from the maven repo. The problem is though 
>>>>> that the
>>>>> source is not resolved and there is no setting to tell eclipse how 
>>>>> to do
>>>>> it.
>>>>> The source for the eclipse bundles is resolved so I guess it has 
>>>>> to do
>>>>> with
>>>>> the fact how the source is bundled.
>>>>> Is there any way to use the sources from maven in eclipse plugin
>>>>> dependencies? If not then I think it would be great to setup the 
>>>>> camel
>>>>> build
>>>>> in such a way that the source is bundled in a way that works in 
>>>>> eclipse
>>>>> plugin dependencies. Is this possible?
>>>>> Gereetings
>>>>> Christian
>>>>> -- 
>>>>> ----
>>> -- 
>>> ----


View raw message