Question

I'm creating a product based on Eclipse 3.6.2 for our project. The idea is to create an Eclipse installation that has all the plugins we require and all configuration are setup as we need them for the project.

As part of that, I want to make sure our update sites are included, but how can I do that?

If I choose to export preferences update sites are not included. I can export update sites from the preference page and get an XML file with them, but how can I include it in my config.ini file? Or is there some other way?

Goal is, when the user runs the custom Eclipse product our update sites will be in the list of sites. Ideally, the only ones in the list.

Was it helpful?

Solution

You can add a p2.inf file that instructs particular update sites when things are installed:

instructions.configure=\
addRepository(type:0,location:http${#58}//www.eclipse.org/equinox/p2/testing/updateSite);\  addRepository(type:1,location:http${#58}//www.eclipse.org/equinox/p2/testing/updateSite);

This would add www.eclipse.org/equinox/p2/testing/updateSite.

This file (p2.inf) needs to go in the same directory as your MANIFEST.MF file. You can read more about this here.

OTHER TIPS

Since there is a likely chance I'll have to do this again, and no chance I remember how to do it the next time, I'll write down the steps I went through:

I created a p2.inf file with instructions;

instructions.configure=\
org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:http${#58}//<my_url_here>,name:<my_name_here>,enabled:true);\
org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:http${#58}//<my_url_here>,name:<my_name_here>,enabled:true);\
org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:http${#58}//<my_url_here>,name:<my_name_here>,enabled:true);\
org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:http${#58}//<my_url_here>,name:<my_name_here>,enabled:true);`

According to the Eclipse wiki the inf-file could be placed in the same dir as my feature.xml, so that's what I did.

I had a product that consisted of this feature, so I exported the product using Eclipse product export wizard. I made sure to build a repository.

After the build was done, the repository had a content.jar. Inside the content.jar there was a content.xml. Examining it, I could find:

<touchpointData size='1'>
   <instructions size='1'>
     <instruction key='configure'>
       org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(<all my update sites>);
     </instruction>
   </instructions>
 </touchpointData>

So this verified that the export did actually see my p2.inf file and do something with it.

To install from the repository I used an Eclipse Director script:

cmd /c "C:\Program\Eclipse\director\director -consoleLog -bundlepool c:/program/eclipse/eclipse3.6_custom -profileProperties "org.eclipse.update.install.features=true" -i MyProduct.Product -r "file:/C:\eclipse\exported\repository" -d c:/program/eclipse/eclipse3.6_custom -p helios"`

The script installed the product from the repository to the destination.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top