[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-dev] Adding OSGi Bundles / TychoOsgiRuntimeArtifacts

Hi,


I'm trying to adapt the following example to the Tycho world.

https://github.com/takari/m2eclipse-discovery


The setup is as follows:

1. eclipse-plugin with "shared" code

2. eclipse-plugin with implementation

3. maven-plugin with dependency on 1


The issue I'm facing with tycho 0.25-SNAPSHOT is class-loading related.


In the Takari example, the shared code is also added to the OSGi framework. If I go down that path, it causes ClassCastExceptions in the Maven plug-in because the shared code is then not really shared but loaded twice.


If I simply leave out TychoOsgiRuntimeArtifacts, the implementation plug-in won't resolve. Thus, I need to make the OSGi framework use the shared code loaded by Maven. In order to do that, I extended TychoOsgiRuntimeArtifacts to allow adding extra system packaged to the framework class path.


That makes the implementation bundle now resolving successfully, but it still can't load the class. The reason is that the framework (started by sisu-equinox-embedder) is loaded by a class loader of a Tycho plug-in, which does not see the shared code of the bundle I created.


Has anyone tried this before? Any tips? The goal of this exercise is to interact with p2 API from within my Maven plug-in.


-Gunnar


-- 

Gunnar Wagenknecht

gunnar@xxxxxxxxxxxxxxx