Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
606 views
in Technique[技术] by (71.8m points)

eclipse - Adding update site URLs to find third-party dependencies during install

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

UPD.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...