views:

1684

answers:

2

Eclipse 3.4[.x] - also known as Ganymede - comes with this new mechanism of provisioning called p2.

"Provisioning" is the process allowing to discover and update on demand some parts of an application, as explained in general in this article on the Sun Web site.

Eclipse has an extended wiki section in which p2 details are presented. Specifically, it says in this wiki page that p2 will look for new components However after reading it.

I suppose (but you may confirm that point by your own experience), that p2 can function file "file://" protocol, which would allow it to provision with local file (either on your computer or on an UNC path '\server\path'), as illustrated here, but also by the files:

  • [eclipse-SDK-3.4-win32]\eclipse\configuration\.settings\org.eclipse.equinox.p2.artifact.repository.prefs
  • [eclipse-SDK-3.4-win32]\eclipse\configuration\.settings\org.eclipse.equinox.p2.metadata.repository.prefs

p2 mechanism is used to update eclipse itself, through an eclipse 3.4 update site, and reference in those '.prefs' files with line like:

repositories/file\:_C\:_jv_eclipse_eclipse-SDK-3.4-win32_eclipse/url=file\:/C\:/jv/eclipse/eclipse-SDK-3.4-win32/eclipse/

Now, how could I replicate the eclipse components present in that update site into a local directory and reference those components through the mentioned '.prefs' files, in order to have an upgrade process entirely run locally, without having to access the web?
I suppose that some p2 metadata files present in the distant 'update site' need to be replicated and changed as well.

Do you have any thoughts/advice/tips on that ? (i.e. on how to discover and retrieve and update the complete structure needed for a full eclipse installation, in order to run that installation locally)

+1  A: 

It seems like you need to have one update work via the web which will mirror (download) what you need. But after that it should be able to get the files from the local peer. But I guess that is your question - does it need web access to determine that...

Chris Kimpton
There is that side of the question (replicate from the web to local) but also the other side (i.e. 'local'): what I have to setup to declare a local provisioning site ? To replicate components is not enough. There a local metadata files to declare that I am not familiar with.
VonC
+5  A: 

Yes, you can specify the repository locations if you use the p2.director

this for example is a snippet of a script that I use to install eclipse (Ganymede) from a local copy of the Ganymede repository

./eclipse\
      -nosplash -consolelog -debug\
      -vm "${VM}"\
      -application org.eclipse.equinox.p2.director.app.application\
      -metadataRepository file:${SHARED_REPOSITORY_DIR}\
      -artifactRepository file:${SHARED_REPOSITORY_DIR}\
      -installIU "${4-org.eclipse.sdk.ide}"\
      -destination "${3}"\
      -profile "${1}"\
      -profileProperties org.eclipse.update.install.features=true\
      -bundlepool ${SHARED_BUNDLEPOOL_DIR}\
      -p2.os linux\
      -p2.ws gtk\
      -p2.arch "${2}"\
      \
      -vmargs\
        -Xms64m -Xmx1024m -XX:MaxPermSize=256m\
        -Declipse.p2.data.area=${SHARED_P2_DIR}

Here are some links to use the p2 director

http://eclipse.dzone.com/articles/understanding-eclipse-p2-provi
http://wiki.eclipse.org/Equinox_p2_director_application

lothar
Thank you for that update. I will evaluate and test it :)
VonC