Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » p2: Unable to specify an associate/referenced repository
p2: Unable to specify an associate/referenced repository [message #840671] Tue, 10 April 2012 11:08 Go to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 335
Registered: July 2009
Senior Member
Hello all,

I am building a p2 repository for a feature. Apart from dependencies on
the Eclipse platform, this feature has dependencies to bundles that can
not be found in the default repositories (those that ship with the
Eclipse SDK download).

Now I learned that a repository can have associate/referenced
repositories. Only I can't make them work.

First, I tried to add an update site reference to the feature.xml file.
According to [1], this should be converted into a repository reference
by the p2 publisher. The site reference look like this:
<url>
<discovery label="Associated repo" url="http://..."/>
</url>
But the content.xml produced by the tycho-based build does not contain
the expected repository references.

Next, as also suggested in [1], I tried to specify the referenced
repository in a p2.inf like so:
instructions.collect=\
addRepository(type:0,location:http${#58}//...,enabled:true);\
addRepository(type:1,location:http${#58}//...,enabled:true);
Though the information ends up in the content.xml, it seems to be
ignored. While installing (Eclipse > Help > Install new Software) the
feature, the p2 installer complains about unresolved dependencies (those
that are contained in the associate repository).
Variations to the above didn't succeed either:
* instructions.install instaed of instructions.collect
* org.eclipse.equinox.p2.touchpoint.eclipse.addRepository instead of
just addRepository

Sorry that this post got rather lengthy but I hope you are still with me
and can give me some hints why this doesn't work.

TIA
Rüdiger Herrmann

[1] http://dev.eclipse.org/mhonarc/lists/p2-dev/msg04147.html
Re: p2: Unable to specify an associate/referenced repository [message #846679 is a reply to message #840671] Mon, 16 April 2012 16:35 Go to previous message
Pascal Rapicault is currently offline Pascal RapicaultFriend
Messages: 333
Registered: July 2009
Location: Ottawa
Senior Member
The reference you add in the p2.inf ends up in an IU action and those are only known when the actions are executed, which happens during the actual installation and not during the resolution. For example this is used to add repositories to an installation for the user to be able to discover new items.

What you need instead is to use the <reference> tag in the metadata repository. These will be considered at resolution time. For example

<references size='2'>
<repository uri='http://download.eclipse.org/eclipse/updates/3.5' url='http://download.eclipse.org/eclipse/updates/3.5' type='0' options='1'/>
<repository uri='http://download.eclipse.org/eclipse/updates/3.5' url='http://download.eclipse.org/eclipse/updates/3.5' type='1' options='1'/>
</references>

The authoring of these entries is done by using the associateSiteURL tag in the site.xml of your update site and listing in a file the sites that need to be used.
Note though that if you are trying this using PDE export, you will not find the references in the resulting metadata repository because of bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=376893 however this should work with tycho.

Finally another solution is to use a composite repository (http://wiki.eclipse.org/Equinox/p2/Composite_Repositories_%28new%29)

HTH

=-=-=
Pascal
Consulting, training, bug fixing - pascal at rapicault dot net

Previous Topic:equinox http service w/o jetty but with https
Next Topic:[P2] RCP Export keeps old repo location in prefs
Goto Forum:
  


Current Time: Thu Apr 25 11:29:41 GMT 2024

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

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

Back to the top