Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] Get Metadata of a given repo from Tycho

Yes, all the p2 things are only usable in OSGi bundles.

 

In order to get access to such a functionality, you’d define an interface in a “shared bundle”, provide an implementation in a normal bundle and register that implementation as OSGi service, and then obtain the instance from the mojo via EquinoxServiceFactory.getService(Class<T>). The “shared bundles” bridge the two classloader worlds: They are loaded by the Maven class loader and exposed to the real OSGi bundles as extra system packages (see TychoOsgiRuntimeLocator).

 

AFAIK, Igor has implemented explicit support for extending Tycho’s OSGi runtime, e.g. for your own OSGi services. To do this, you’d need to create your own shared bundle and implementation bundle. The implementation bundle can be added to the OSGi runtime via a new TychoOsgiRuntimeArtifacts component. (To add components, you’d need to add the jar defining the component as extra dependency of the Tycho build extension AFAIK.) Your shared bundle also needs to be added as dependency to Tycho’s build extension. AFAIK, there is no extension mechanism for additional system packages, but this shouldn’t be hard to add.

 

I’ve never seen this in practice, so if you get this to work, I’d be interested to see it.

 

Regards

Tobias

 

From: tycho-dev-bounces@xxxxxxxxxxx [mailto:tycho-dev-bounces@xxxxxxxxxxx] On Behalf Of Mickael Istria
Sent: Freitag, 12. September 2014 11:56
To: tycho-dev@xxxxxxxxxxx
Subject: Re: [tycho-dev] Get Metadata of a given repo from Tycho

 

Thanks for this answer.
It seems to me that IArtifactRepository interface (and family) are only visible from inside Equinox, and cannot be accessed directly from a Mojo. Am I right? If so, does it means I'd need to wrap it in a service (similarly to how BaselineService works) ? Is it possible to define/register additional Equinox services from a Mojo ?

--
Mickael Istria
Eclipse developer at JBoss, by Red Hat
My blog - My Tweets


Back to the top