I tried to add Apache Camel support in an Eclipse RCP application. With the new Eclipse, I can also add maven repositories in the target platform file, so that is what I did. My target platform contains:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>4.6.0</version>
<type>jar</type>
</dependency>
I also checked the includeDependency field to include the required dependencies. All is well so far, I get all 20 or so plugins for the camel projects auto-generated. I add them in my manifest files, compile is working, everything is fine. Except when I try to start camel, I get a runtime exception saying No language for 'simple' found
(something similar, I don't have the exact stackstrace now).
The problem is this one:
- The
simple
language is in the core-languages module - The
core-engine
module tries to load thesimple
language(from thecore-languages
) into the camel context core-engine
andcore-languages
are 2 distinct plugins, thus the Equinox classloader will not allowcore-engine
to see any files in the META-INF folder inside thecore-languages
module
I can only think of 2 possible solutions for this:
- Include Apache Camel as a jar dependency. The problem is I don't see any downloadable jar for the core Apache Camel in Maven. I will have to clone the repositories and build my own jar.
- Build a Maven project that takes all Camel core dependencies and outputs a single rcp plugin containing the dependencies. For this one I don't need to clone the Camel repositories, but I'm not 100% sure I can achieve this.
For both approaches I think is quite cumbersome to add another Camel component afterwards, because it will probably involve modifying the custom project I created to include the new component(assuming core-engine
needs to access it to load it into the context). Also I don't see how I can separate the Camel core from the optional components.
Any ideas to make Camel work with Eclipse RCP?
You can find my target platform here: https://github.com/grozadanut/ro.linic.ui/blob/main/target-platform/target-platform.target
And the RCP product is here: https://github.com/grozadanut/ro.linic.ui/blob/main/ro.linic.ui.product/linic.product