Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Make a maven-plugin that consumes p2 API

For those who might be interested in the future, I found out a way to go:
* Add dependency to tycho-p2-publisher-plugin
* Make your mojo extends AbstractP2Mojo
* Enjoy its "loadCategories" method.

On 02/10/2012 04:03 PM, Mickael Istria wrote:
Hi all,

I'd like to create a Tycho plugins that consumes p2 API. The idea of this plugin is to read the output site of an "eclipse-repository", in order to generate additional files from it.
I took a look at Tycho code in order to find something similar, but I have to admit I did not succeed to find something that would match my use-case. Apparently, it seems that I would have to write the following lines somewhere to be able to consume p2 API:

        ServiceReference providerRef = context.getServiceReference(IProvisioningAgentProvider.SERVICE_NAME);
        IProvisioningAgentProvider provider = (IProvisioningAgentProvider) context.getService(providerRef);
        agent = provider.createAgent(null); // null == currently running system

However, this line depend on OSGi and probably require to be run in an instance of Equinox. And as far as I know, my maven-plugin is not run in an OSGi container...

I imagine Tycho have a nice way to get access to p2 API in Maven plugins. Could you please share some examples of code or tips on this topic?

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

tycho-user mailing list

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

Back to the top