I have an Eclipse feature which when installing on Helios requires an additional update-site URL to be present in order to find certain dependencies. Is it possible to automatically add such an URL so that the user doesn't have to do it manually? Or is it considered bad practice to do so?
I've tried to add addRepository
action to the p2.inf file of the feature, but it is not executed.
The only way I have found is to add repository references into content.jar/content.xml
by hand. For example, to add EMF update site into the list of available update sites one can add the following code to <repository>
node:
<references size="2">
<repository uri="http://download.eclipse.org/modeling/emf/updates/" url="http://download.eclipse.org/modeling/emf/updates/" type="0" options="0"/>
<repository uri="http://download.eclipse.org/modeling/emf/updates/" url="http://download.eclipse.org/modeling/emf/updates/" type="1" options="0"/>
</references>
I did't found any documentation describing what type
and options
attributes mean. Also this solution will not work if the specified update site has already been added to available sites as disabled site (check Window -> Preferences -> Install/Update -> Available Software). In such case it is not enabled, actually I was searching how to enable it unconditionally, and found your question.
There is also an Ant script which simplifies adding associated sites into content.jar/content.xml
.
Please let me know if you'll find a better way.
It is possible to associate a new update site with a slightly different URL, for example
http://download.eclipse.org/modeling/emf/updates/
->
http://download.eclipse.org/modeling/emf/updates/#contributed-by-my-update-site
But I still hope that there is a better solution.
As Raffi comments on Eldars answer an external update site for dependencies can be added by putting the following entry in the feature.xml
file.
<url>
<discovery label="Example Update Site" url="http://example.se/update_site/"/>
</url>
This can also be done through the feature.xml
editor GUI, in the Information → Sites to Visit tab.
In the GUI this is described as "update sites to visit while looking for new features".
This seem to generate the entries in content.jar/content.xml
that Eldar describes in their answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With