EzDevInfo.com

p2.js

JavaScript 2D physics library schteppe.github.com

A working example of custom p2 provisioning action

I’m trying to write a custom p2 provisioning action to execute my own code when installing feature. Doing so with installHandler for Update Manager was easy, but as for p2, there’s absolutely no docs on this topic in the web, most of the time eclispe just silently ignores me (even in a log), and the only example I’ve found is not working.

So, if somebody can point me at a working example of custom provisioning action, that would help me understand the whole thing.

Thanks.


Source: (StackOverflow)

usage of maven tycho-p2-plugin with SWT

how do I build a swt application using the eclipse p2 repository and the maven tycho-p2-plugin?


Source: (StackOverflow)

Advertisements

Best way to build update site for RCP app

I have an RCP app, consisting of:

  • A main plugin
  • A "framework" plugin
  • A product definition file

  • The product definition file lives in the main plug-in (is this a bad idea?).

    The product definition is based on "plug-ins", and has a dependency upon all the plug-ins in the workspace.

    Now, I want the user of the RCP app to be able to update the app. This includes new / changed HTML help files, new plug-ins, changed code in existing plug-ins etc.

    What do I need to be able to do this?

    What is the best way to set up my workspace / project heirarchy?


    Source: (StackOverflow)

    Tool for managing/hosting own p2 repositories?

    Our company uses Maven. We use the Nexus repository manager in order to store our snapshots and releases.

    Currently, we are developing a product based on Eclipse. We use Tycho to do that.

    The problem is the following: In our Eclipse-based product we have many features. Our idea is build each feature (or group of features) separately and put them in internal p2 repositories. When one features requires another feature, we point the target platform to necessary internal p2 repository.

    Currently, we build application with Tycho. We make our features "deployable", so Tycho produces a P2 site in target. We push that P2 site to our server and then run Eclipse FeaturesAndBundlesPublisher, which merges that recently-built feature with a P2 repository. As a result, we have a internal P2 repository having all the versions of required feature.

    We find that this process is too cumbersome. Is there a tool like Nexus, which would be more convenient?

    UPD.:There is a discussion on Tycho Users list


    Source: (StackOverflow)

    Tool for downloading eclipse plugins from update sites

    I need to install an eclipse plugin to a machine not connected to the Internet and I cannot find a dist to use for a local install.

    Is there a tool for downloading a plugin from an update site and create a local installation archive (or a local update site)? Rumors says you can do this with eclipse, but I cant find any info on how to do it.


    Source: (StackOverflow)

    Is it possible to make an eclipse p2 provisioning mechanism running *locally*?

    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)


    Source: (StackOverflow)

    Eclipse doesn't load plugins in the dropins folder

    I just downloaded Eclipse SDK 3.5.1 and want to install some add ons such as GEF, EMF, etc.

    I downloaded all the zip files for everything I needed and decided to install them in the dropins folder. I read http://wiki.eclipse.org/Equinox_p2_Getting_Started and structured my dropin folder as specified:

    eclipse/  
       dropins/  
         emf/  
           eclipse/  
             features/  
             plugins/  
         gef/  
           eclipse/  
             features/  
             plugins/  
         ... etc ...
    

    When I start up Eclipse it does not recognize any of the features or plugins I have put into the structure above. Any ideas?


    Source: (StackOverflow)

    Do you know update site addresses for *latest* eclipse components?

    I am looking for all addresses related to:

    • 3.x eclipse itself (milestones and/or integration builds)
    • 3.x other components (GEF, GMF, EMF, ...)

    In the spirit of answering my own question, I do have an answer for:

    However, If you have further addresses, either for eclipse or other eclipse components, please publish them here.


    Source: (StackOverflow)

    Running P2 Ant tasks outside Eclipse

    I got ant script running fine inside Eclipse Here is a piece of it :

    <p2.composite.repository failOnExists="true">
                <repository location="file:/${basedir}/compRepo" name="Repository description goes here" />
                <add>
                    <repository location="http://url/Eclipse/repo/Galileo-3.5.1/" />
                    <repository location="http://another-url/Java/repo/4.0/" />
                    <repository location="${diag.location}" />
                </add>
            </p2.composite.repository>
    

    But I would like Hudson CI server to be able to run it, but, no matter all the jars I put in ANT_HOME/lib I can't get this task to run in a simple command line ant... I got stuck with this error :

    C:\workspaces\workspace\project\junit.script\createCompRepo.xml:10: Problem: failed to create task or type p2.composite.repository
    Cause: The name is undefined.
    Action: Check the spelling.
    Action: Check that any custom tasks/types have been declared.
    Action: Check that any <presetdef>/<macrodef> declarations have taken place.
    

    Where are defined the p2 ant tasks ? Is there a way to run them outside Eclipse ? Thank you very much for you help ! Anthony


    Source: (StackOverflow)

    In Equinox Is it possible to to mark an OSGi bundle as started from its containing feature's p2.inf?

    I have an Eclipse feature which includes several bundles. I want to tell p2 to mark one of those bundles as started when the feature is installed. This is possible using the bundles own META-INF/p2.inf like so,

    instructions.configure = markStarted(started: true)
    

    but I want to do this at the feature-level rather than the bundle-level (the bundle in question is third-party, and I'd prefer not to modify it in any way, if possible).

    Some research has led me to this document which suggests that it should be possible to move the configure instructions to the containing feature's p2.inf. I've tried all the obvious things like,

    units.0.id = <bundle symbolic name>
    units.0.instructions.configure = \
      org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started: true)
    

    but so far none of the permutations I've tried have any effect: as in nothing happens, the bundle isn't marked as started and no errors are reported).

    Any pointers would be very welcome. The is with Eclipse Equinox Galileo (3.5.2) ... answers relating to Helios would also be very useful.


    Source: (StackOverflow)

    Eclipse RCP built by Tycho includes unwanted optional dependencies

    This is a question which has been frequently asked in the Tycho community:

    I migrated my Eclipse RCP build from [previous technology, e.g. eclipse-application/ PDE headless build / ...] to the new recommended way of building products with Tycho using the packaging type eclipse-repository. Now my distribution contains more bundles than before.

    The problem seems to be that Tycho pulls in the optional dependencies of the bundles included in my product. How can I prevent this?


    Source: (StackOverflow)

    Can Eclipse 3.5 discover all bundles in the plugins dir?

    Simple usecase: assemble an Eclipse product using simple scripts, just dumping bundles into the plugins dir. This used to work with 3.3 - with 3.5 it's broken: my application doesn't start as the app plugin is not found.

    Question: what's the easiest way to fix that? This seems to be the only pain in the whole upgrade process for me.


    Attempts: I guess this is a no-no for P2: it maintains the bundles.info file instead, which is probably very smart.. a bit too smart for me.

    Some ideas I had:

    1. can I just skip P2 altogether and get back to plain old, simple -dirty- discovery mechanism?
    2. can I set up plugins dir as a 'watched directory'
      • looks like I need to use the p2.reconciler for that.. oh wait, it's deprecated already :-( bug 251561.. (thanks VonC for the pointer)
    3. can this old setting in the config.ini still work? (which is now replaced with the 'simpleconfigurator') osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.core.runtime@start
    4. should I call the (p2) director? "please pick my plugins up" :)
    5. I'd avoid the dropin folder for this - that's more for the end-users.
    6. I'd avoid messing with the bundles.info if possible.

    I don't care about all those smart features in my product yet- actually the users don't use the built-in update mechanism at all. So I'd like to KISS (ie: just to start up), and add more advanced support when needed.

    I've asked this on Eclipse forums, but no answer yet, so would really be grateful for some enlightenment. Also, feel free to correct me on the assumptions - I've just read the P2 docs, which seem confusing at times. Thanks!


    Answer: actually option 3 above seems to work after all - thanks Francis for confirming this! (it didn't work originally, but that was probably caused by some missing deps). My only issue with that now is, some Eclipse bundles actually require simpleconfigurator. So I wonder if swapping it out will cause problems down the line.


    Source: (StackOverflow)

    How do I build an Eclipse RCP app so that its features can be updated automatically?

    I am building an RCP application that will be made up of several Features.

    My RCP application is configured to check for updates each time it starts. My current problem is that I need one of my Features to be 'Installed' at build time so that it will get updated during this automatic check for updates without forcing the user to manually install it. I need this feature to update independently from the other features in the system.

    So, to recap, I'm just looking for a nice automated way to have a Feature installed in an RCP app in such a way that it updates independently from other features, and doesn't require the user of the RCP app to install it manually.


    Source: (StackOverflow)

    Define update sites in config.ini file

    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.


    Source: (StackOverflow)

    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.


    Source: (StackOverflow)