Eclipse product: how to clone the plugin version? - eclipse

This may sound a bit strange, but i would rather avoid having to check the product version field each time i have to make an export.
Is there a way that the product version can be updated with the Plugin version?

In our headless build, our .product file product element has version="0.9.0.#qualifier#". Our customTargets.xml has a <replace token="#qualifier#" ... on the file before we call p2.publish.product.
A product export from the Product Configuration Editor seems to auto-update the qualifier in the .product file.
If you mean syncing the main part of the product version to a plugin in the product (like the product version 1.4.2 will match plugin X 1.4.2) I don't believe there's any support for that.
PW

Related

product configuaration in the eclipse plugin development

Requirements using:Eclipse Mars(4.5.2) and Jdk(1.8.0)
Problem: I have created the plug-in-project called [org.basicfamily.sirius.design].
Then the product configuration was created for the plug-in [org.basicfamily.product.demonstrator] and the plug-in project [org.basicfamily.sirius.design] was added as contents to the created product configuration and selected the required dependencies for the plug-in [org.basicfamily.sirius.design]. Now the plug-in [org.basicfamily.sirius.design] is dependent on the another plug in called [org.antlr.runtime[1.6.0,1.7.0)]. But the problem now is when I try to export the product it is giving [org.antlr.runtime[1.6.0,1.7.0)] bundle version exception plug in org.antlr.runtime[1.6.0] is not found. Because in the contents of the product configuration we can add the plug-in only with respect to name and not with respect to versions. So I want to add the plug-ins org.antlr.runtime[1.6.0],org.antlr.runtime[1.7.0] both but it allows only one plug-in with the same name. It will consider the plugins only with respect to the name and not w.r.t the versions.
Any solution for this problem?
Switch to using a 'feature' based build. In the 'feature.xml' for a feature you can specify the version of the plugin required.
So you can use a feature for the plugins which use the 1.6 plugin and another feature for the plugins requiring 1.7.

If 2 versions of a plugin are stored in eclipse plugin directory, how does eclipse determine which to use

In Eclipse plugin directory I have plugin jar called someplugin.1.jar dated yesterday and someplugin.2.jar dated today.
How does eclipse decide which one to use?
Thanks.
The name of the JAR is irrelevant; if they are bundle/plugin JARs, it's the contents of their manifest.mf files that Eclipse uses to determine the ID and version of the bundle/plugin they contain.
If they are the same plugin ID but different versions, then which one is loaded is based on expressed dependencies of other plugins. It's possible that they both can be loaded (assuming the plugin is not marked as a singleton), if there are other plugins that depend on the different versions (although that is rare).
If the plugin is a singleton (most are, because they have to be in order to contribute to extension points), then I'm pretty sure the one with the higher version will be chosen if there are no dependencies that dictate otherwise. If both JARs have the same plugin ID and version then I don't think there is deterministic behavior about which one will show up in runtime.

Eclipse RCP: building product with feature that requires other features

I need to build a product that contains one feature, I want this feature, containing application, requires another feature that can be updated independently from product, so I put this last one in required section and not in included section.
the tree is this:
it.prodotto (product id)
it.rcp.prototipo.application.feature (main feature included in product and containing application)
it.rcp.framework.feature (feature required by main feature)
My problem is this, even if I have these features (and relatively plugins) in my target, when I export my product using eclipse wizard from .product I got this error:
Cannot complete the install because one or more required items could not be found.
Software being installed: prototipo application 1.0.7 (it.prodotto 1.0.7)
Missing requirement: My Application 1.0.4 (it.rcp.prototipo.application.feature.feature.group 1.0.4) requires 'it.rcp.framework.feature.feature.group 1.0.4' but it could not be found
Cannot satisfy dependency:
I don't understand where (and how) I have to put this features before export the product
I also tried to put this required feature in the same folder where I export the product without success (I tried both launchingfolder and repository)
I'm using Eclipse Helios 3.6.1
The feature it.rcp.framework.feature must be added to the product configuration as well.

Eclipse RCP: build product able to load all plugins in plugins directory

I need to configure my eclipse product to load all features/plugins in features/plugins directory. Now my product loads just plugins that are listed in metadata, so if I export some plugin directly from eclipse tool as "deployable plugins" it's loaded in my product, but if I put a plugin jar directly in plugins directory It doesn't appear (the same if I work with features)
I simply make new product configurations, put the feature that contains my application plugin and then exporting product I have this problem.
My eclipse version is 3.6.1
I think the problem is in the launcher configuration but I don't know what I have to change
In theory, your exported RCP application should simply pick up any new features and plugins you add later. However, make sure you put the extra stuff in the dropins folder of your RCP, since this is the expected location for manually installed features since the introduction of p2.
If for some reason it still doesn't work, try launching Eclipse with the -clean command line argument.
According to The Eclipse runtime options page, the -clean argument has the following effect:
[...] any cached data used by the OSGi framework and eclipse runtime will be wiped clean. This will clean the caches used to store bundle dependency resolution and eclipse extension registry data. Using this option will force eclipse to reinitialize these caches.
In my experience this can resolve many mysterious cases, where newly added plugins are not loaded by Equinox.

Modifying Existing Eclipse Plugin and Correctly Installing it

I downloaded the source code for the EMF based UML2 Plugin and changed a class in the org.eclipse.uml2.uml.edit project to remove special characters when returning string representations. Now when I export the projects and place the jar files either in the dropins directory or replace my current uml2 plugin jar files in plugins directory, The UML files are no longer recognized, in short my modified plugin does not install correctly (no error is thrown and I can see the files being picked up under Plugins->Target Platform) .
However, When I run the plugin as an eclipse application (from the workspace) I can see the changes I made being reflected in the new instance of eclipse.
What can I do to ensure that the plugin installs correctly?
Is there a documented procedure of how to build the uml2 plugin (or any comparable plugin) after modification?
Select the project and open the context menu. There is an entry PDE near the bottom of the menu. In there, you can find an entry to build the plugin for deployment. This gives you the features and plugins directory with the fixed files. Copy both into your Eclipse install.
Unless the UML2 plugins require some kind of magic build script, exporting the one plugin you changed and overwriting the original in your Eclipse installation should be the easiest solution. One potential problem which comes to mind is conflicting plugin version numbers: make sure you don't have two identical versions of your modified plugin in your Eclipse installation.
When debugging plugins which apparently don't work properly at runtime, I always look at Help > About Eclipse Platform > Configuration Details. This lists all the plugins found by Equinox during startup, along with their status (see the Javadoc of the org.osgi.framework.Bundle interface for explanation).
I faced the exact same problem as you describe here . I dont have any answer to your problem but i am sharing what worked for me .
I created a local update site of the plugin on my system. Create update site for your plug-in article explains very very nicely the steps needed to accomplish this .