Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to create a p2 repo programmatically
How to create a p2 repo programmatically [message #537131] Tue, 01 June 2010 12:33 Go to next message
chathuri is currently offline chathuriFriend
Messages: 6
Registered: July 2009
Junior Member
Hi all,

I want to create a P2 repo programmatically with my plugin. Any reference I can follow ?

Thanks..

Chathuri
Re: How to create a p2 repo programmatically [message #537144 is a reply to message #537131] Tue, 01 June 2010 13:01 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

Hi,

chathuri a écrit :
> Hi all,
> I want to create a P2 repo programmatically with my plugin. Any
> reference I can follow ?

You should try this page: http://wiki.eclipse.org/Equinox/p2/Publisher

--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
Re: How to create a p2 repo programmatically [message #537239 is a reply to message #537144] Tue, 01 June 2010 15:52 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Mickael Istria wrote:
> Hi,
>
> chathuri a écrit :
>> Hi all,
>> I want to create a P2 repo programmatically with my plugin. Any
>> reference I can follow ?
>
> You should try this page: http://wiki.eclipse.org/Equinox/p2/Publisher

While the wiki doesn't show any programmatic examples, those publisher tasks
do create p2 repos, so you can go look at their source code.

The source is in cvs at dev.eclipse.org, /cvsroot/rt,
org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.publis her

As a particular example the p2.publish.featuresAndBundles ant task is
implemented by the class FeaturesAndBundlesPublisherTask, which will create
a repository or append to an existing one.

Find the repo creation code at Publisher#createMetadataRepository (and
createArtifactRepository).

-Andrew
Re: How to create a p2 repo programmatically [message #537327 is a reply to message #537239] Wed, 02 June 2010 01:13 Go to previous messageGo to next message
chathuri is currently offline chathuriFriend
Messages: 6
Registered: July 2009
Junior Member
HI,

Thanks for the info. I was able to create p2 repo half way by invoking "run" method of org.eclipse.equinox.launcher.Main() class. But the problem is, it copied only the artifacts.jar and content.jar to the given location. It did nt copy "Plugins" and "Features" folders.

I will try with the org.eclipse.equinox.p2.publisher as well..

Thanks.

Chathuri.
Re: How to create a p2 repo programmatically [message #537359 is a reply to message #537239] Wed, 02 June 2010 07:52 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

Hi Andrew,

>> You should try this page: http://wiki.eclipse.org/Equinox/p2/Publisher
>
> While the wiki doesn't show any programmatic examples, ...

Is this example wrong: http://wiki.eclipse.org/Equinox/p2/Publisher#Extensible_API ?

--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
Re: How to create a p2 repo programmatically [message #537514 is a reply to message #537359] Wed, 02 June 2010 17:28 Go to previous messageGo to next message
chathuri is currently offline chathuriFriend
Messages: 6
Registered: July 2009
Junior Member
Hi Mickael,

You are correct. I was able to create a p2 repo with the example you have pointed. Only problem with that code is, in the createActions method, it does nt pick features folder. It only picks plugins folder.

public static IPublisherAction[] createActions() {
IPublisherAction[] result = new IPublisherAction[2];
File[] bundleLocations = new File[1];
bundleLocations[0] = new File("/location to bundles/");
BundlesAction bundlesAction = new BundlesAction(bundleLocations);
FeaturesAction featureAction = new FeaturesAction(bundleLocations);
result[0] = bundlesAction;
result[1] = featureAction;
return result;
}

Hope this may helpful.

Chathuri
Re: How to create a p2 repo programmatically [message #537547 is a reply to message #537359] Wed, 02 June 2010 20:01 Go to previous message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Mickael Istria wrote:

> Hi Andrew,
>
>>> You should try this page: http://wiki.eclipse.org/Equinox/p2/Publisher
>>
>> While the wiki doesn't show any programmatic examples, ...
>
> Is this example wrong:
> http://wiki.eclipse.org/Equinox/p2/Publisher#Extensible_API ?
>
> --
> Mickael Istria - BonitaSoft S.A.
> http://www.bonitasoft.com/products/downloads.php

Oh sorry, you are right. I only really looked at the first half of that
page and didn't see that part at the bottom.

That example should work fine, although it does use some internals
(*RepositoryFactory), you could use Publisher#createMetadataRepository
instead of using the factory.

-Andrew
Re: How to create a p2 repo programmatically [message #605902 is a reply to message #537131] Tue, 01 June 2010 13:01 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

Hi,

chathuri a écrit :
> Hi all,
> I want to create a P2 repo programmatically with my plugin. Any
> reference I can follow ?

You should try this page: http://wiki.eclipse.org/Equinox/p2/Publisher

--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
Re: How to create a p2 repo programmatically [message #605904 is a reply to message #537144] Tue, 01 June 2010 15:52 Go to previous message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Mickael Istria wrote:
> Hi,
>
> chathuri a écrit :
>> Hi all,
>> I want to create a P2 repo programmatically with my plugin. Any
>> reference I can follow ?
>
> You should try this page: http://wiki.eclipse.org/Equinox/p2/Publisher

While the wiki doesn't show any programmatic examples, those publisher tasks
do create p2 repos, so you can go look at their source code.

The source is in cvs at dev.eclipse.org, /cvsroot/rt,
org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.publis her

As a particular example the p2.publish.featuresAndBundles ant task is
implemented by the class FeaturesAndBundlesPublisherTask, which will create
a repository or append to an existing one.

Find the repo creation code at Publisher#createMetadataRepository (and
createArtifactRepository).

-Andrew
Re: How to create a p2 repo programmatically [message #605908 is a reply to message #537239] Wed, 02 June 2010 01:13 Go to previous message
chathuri is currently offline chathuriFriend
Messages: 6
Registered: July 2009
Junior Member
HI,

Thanks for the info. I was able to create p2 repo half way by invoking "run" method of org.eclipse.equinox.launcher.Main() class. But the problem is, it copied only the artifacts.jar and content.jar to the given location. It did nt copy "Plugins" and "Features" folders.

I will try with the org.eclipse.equinox.p2.publisher as well..

Thanks.

Chathuri.
Re: How to create a p2 repo programmatically [message #605914 is a reply to message #537239] Wed, 02 June 2010 07:52 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

Hi Andrew,

>> You should try this page: http://wiki.eclipse.org/Equinox/p2/Publisher
>
> While the wiki doesn't show any programmatic examples, ...

Is this example wrong: http://wiki.eclipse.org/Equinox/p2/Publisher#Extensible_API ?

--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
Re: How to create a p2 repo programmatically [message #605918 is a reply to message #537359] Wed, 02 June 2010 17:28 Go to previous message
chathuri is currently offline chathuriFriend
Messages: 6
Registered: July 2009
Junior Member
Hi Mickael,

You are correct. I was able to create a p2 repo with the example you have pointed. Only problem with that code is, in the createActions method, it does nt pick features folder. It only picks plugins folder.

public static IPublisherAction[] createActions() {
IPublisherAction[] result = new IPublisherAction[2];
File[] bundleLocations = new File[1];
bundleLocations[0] = new File("/location to bundles/");
BundlesAction bundlesAction = new BundlesAction(bundleLocations);
FeaturesAction featureAction = new FeaturesAction(bundleLocations);
result[0] = bundlesAction;
result[1] = featureAction;
return result;
}

Hope this may helpful.

Chathuri
Re: How to create a p2 repo programmatically [message #605923 is a reply to message #537359] Wed, 02 June 2010 20:01 Go to previous message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Mickael Istria wrote:

> Hi Andrew,
>
>>> You should try this page: http://wiki.eclipse.org/Equinox/p2/Publisher
>>
>> While the wiki doesn't show any programmatic examples, ...
>
> Is this example wrong:
> http://wiki.eclipse.org/Equinox/p2/Publisher#Extensible_API ?
>
> --
> Mickael Istria - BonitaSoft S.A.
> http://www.bonitasoft.com/products/downloads.php

Oh sorry, you are right. I only really looked at the first half of that
page and didn't see that part at the bottom.

That example should work fine, although it does use some internals
(*RepositoryFactory), you could use Publisher#createMetadataRepository
instead of using the factory.

-Andrew
Previous Topic:Adding jars to the Common Navigator
Next Topic:Execute eclipse Key binding through java code
Goto Forum:
  


Current Time: Fri Apr 19 05:11:51 GMT 2024

Powered by FUDForum. Page generated in 0.02945 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top