Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Forcing a P2 Update site inside the Eclipse "Update Sites" preferences
Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1784919] Thu, 05 April 2018 18:36 Go to next message
David Coley is currently offline David ColeyFriend
Messages: 37
Registered: July 2012
Member
Trying to figure out based on the documentation how to force the Help -> Check for Updates to use our internal mirrors. The preferences still have the 'default' outside URL listed.

I've used the "record" preference option but I still don't see the update URL.

What is the best way to centrally manage the P2 Update URL's , so that it points to our artifactory server. if I missed it in the docs please redirect me.

I need this to be the default for everyone who will be using this model, so if it is a user setup how do I add that to the main package? Each version of Eclipse has a different internal artifactory location due to historical reasons.
Re: Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1784932 is a reply to message #1784919] Fri, 06 April 2018 04:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
The preference recorder only records instance-scoped preferences and even the Capture Preferences dialog in the Setup Editor toolbar only shows instance preferences. If you install the Oomph Preferences Management feature, i.e., the IU "org.eclipse.oomph.preferences.feature.group'" , the preferences dialog will include Oomph -> All lPreferences and that has an Edit... button to open the preference explorer editor. That editor has a button in the toolbar to "Keep the editor synchronized with changes to the underlying preference store". This allows you to explore all preferences of all scopes and when any preference is changed, the editor will select the modified preference.

Using this approach you'll see that unfortunately these p2 update URL preferences are stored as profile-scoped preferences. And even worse, the key is an encoded URI of the profile's location on disk. I.e., it depends on where the installation is created. The actual *.pref files are located in the profile's folder so when using a shared bundle pool, they're located in, by default, ~/.p2/org.eclipse.equinox.p2.engine/profileRegistry/*.profile/.data/.settings/*.pref.

Worse still, the content metadata of a product IU can include touch point instructions like this:
          <instruction key='configure'>
            org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:http${#58}//download.eclipse.org/releases/latest,name:Latest Eclipse Release,enabled:false);org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:http${#58}//download.eclipse.org/releases/latest,name:Latest Eclipse Release,enabled:false);
          </instruction>


It's all definitely not easy to manage or influence as a result of this overall design. Perhaps the URI(s) you don't want are coming from these touch point instructions and you can change that behavior/result by changing their values in your mirror's metadata (content.jar/content.xml.xz).


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1784985 is a reply to message #1784932] Fri, 06 April 2018 15:43 Go to previous messageGo to next message
David Coley is currently offline David ColeyFriend
Messages: 37
Registered: July 2012
Member
How does Eclipse decide which ones to show per-Eclipse version?
For example if I look at '.p2\org.eclipse.equinox.p2.engine\.settings\org.eclipse.equinox.p2.artifact.repository.prefs' I can see Neon and Oxygen base installs listed.
Re: Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1784996 is a reply to message #1784985] Fri, 06 April 2018 18:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Sorry, I really don't know the details of how p2 manages all its various preferences. But I do know that in ~/.p2/org.eclipse.equinox.p2.engine/profileRegistry/*.profile/.data/.settings/*.pref for each specific *.profile corresponding to each specific installation that this is where the preference you change in the IDE are stored.

For your case it's probably more important to consider where are these values coming from, e.g., if it's from touch points in your mirrored p2 update site you can change it in your update site and not worry about where p2 ends up putting them all.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1785127 is a reply to message #1784996] Mon, 09 April 2018 19:16 Go to previous messageGo to next message
David Coley is currently offline David ColeyFriend
Messages: 37
Registered: July 2012
Member
how would you convert C:\MYDIR\NAME\oomph\java-latest-release\eclipse.profile to C__MYDIR_NAME_oomph_java-latest-released_eclipse.profile
I've tried the variablefilters but can't figure out how to convert it properly.
Re: Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1785155 is a reply to message #1785127] Tue, 10 April 2018 07:18 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi David, I've added a "pathEncode" filter and updated the documentation accordingly. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=533408

Re: Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1785157 is a reply to message #1785127] Tue, 10 April 2018 07:25 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Yes, that's the unfortunate part. There is no filter that does this. Perhaps more direct would be if there were a variable containing the path/URI of the profile; of the self profile in the installation itself and of the target profile in the installer.

Please open a Bugzilla enhancement request, explaining how you want to use this value in your tasks and I can look into what's all needed when I'm back from traveling next week.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1785211 is a reply to message #1785155] Wed, 11 April 2018 03:38 Go to previous messageGo to next message
David Coley is currently offline David ColeyFriend
Messages: 37
Registered: July 2012
Member
Eike,

thanks this works by the looks of things:

${install.root|uri}/.p2/org.eclipse.equinox.p2.engine/profileRegistry/${installation.location|pathEncode}_eclipse.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs


It's a bit of a mouth-full for a path, but it works.

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0">
  <setup:ResourceCreationTask
      content="eclipse.preferences.version=1&#xA;repositories/http\:__mydomain.com_dist_eclipseide_update_4.7qa_common_site/url=http\://mydomain.com/dist/eclipseide/update/4.7qa/common/site/&#xA;repositories/http\:__mydomain.com_dist_eclipseide_update_4.7qa_common_site/enabled=true&#xA;repositories/http\:__mydomain.com_dist_eclipseide_update_4.7qa_common_site/isSystem=false&#xA;repositories/http\:__mydomain.com_dist_eclipseide_update_4.7qa_common_site/name=Eclipse 4.7qa Repository"
      targetURL="${install.root|uri}/.p2/org.eclipse.equinox.p2.engine/profileRegistry/${installation.location|pathEncode}_eclipse.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs"
      encoding="UTF-8"/>
  <setup:ResourceCreationTask
      content="eclipse.preferences.version=1&#xA;repositories/http\:__mydomain.com_dist_eclipseide_update_4.7qa_common_site/url=http\://mydomain.com/dist/eclipseide/update/4.7qa/common/site/&#xA;repositories/http\:__myweb.ms.com_dist_eclipseide_update_4.7qa_common_site/enabled=true&#xA;repositories/http\:__mydomain.com_dist_eclipseide_update_4.7qa_common_site/isSystem=false&#xA;repositories/http\:__mydomain.com_dist_eclipseide_update_4.7qa_common_site/name=Eclipse 4.7qa Repository"
      targetURL="${install.root|uri}/.p2/org.eclipse.equinox.p2.engine/profileRegistry/${installation.location|pathEncode}_eclipse.profile/.data/.settings/org.eclipse.equinox.p2.artifact.repository.prefs"
      encoding="UTF-8"/>
</xmi:XMI>


Wondering if this is worth putting up on the Authoring Wiki as an example similar to PDE example etc.

I really appreciate your quick turnaround for this fix. It has made my life much easier.... until my next roadblock

[Updated on: Wed, 11 April 2018 03:45]

Report message to a moderator

Re: Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1785215 is a reply to message #1785211] Wed, 11 April 2018 06:09 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
I'm glad that it works. I also agree with Ed, that new variables would be more direct and easier to use in this case. If you open a bugzilla we can look at that.

Re: Forcing a P2 Update site inside the Eclipse "Update Sites" preferences [message #1785260 is a reply to message #1785215] Wed, 11 April 2018 16:27 Go to previous message
David Coley is currently offline David ColeyFriend
Messages: 37
Registered: July 2012
Member
I'll look at the bugzilla later, restrictions limit it currently.
One thing to note for those reading this thread, As of April 11 2018 - you will need to also patch your Eclipse Install to either auto-update to the April 10 2018 oomph.setup.ui feature or patch the core install.
Previous Topic:Subproject selection behaviour
Next Topic:Filter by path pattern in Dynamic Working Sets
Goto Forum:
  


Current Time: Thu Apr 25 14:29:19 GMT 2024

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

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

Back to the top