Eclipse RCP: building product with feature that requires other features - eclipse-rcp

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.

Related

How to synchronize run configuration with product configuration in Eclipse?

I am trying to run an Eclipse product that is configured to use features.
The features added by me are:
org.eclipse.e4.rcp
org.eclipse.emf.ecore
org.eclipse.emf.common
The product will run after using the run configuration->add required plugins button (the product plugin itself is missing example: if the product plugin is called com.company.product I will get a validation error that com.company.product is missing).
If I am using "Launch an Eclipse application" I will get the error "No application id found". This is also obviously reflected in the exported product.
I tried to add the product plugin as dependency but I can't find it. Still the "add required plugins" can add it.
Why is the product plugin itself required and how to add it in the configuration such that the exported product can run ?
I' not sure I really understand the question, but if you are using a feature based product you need to write a feature containing all of your plugins including the one that defines the product using the org.eclipse.core.runtime.product extension point.
Every plugin that you want to be included in the RCP must be listed in a feature and all the features must be listed in the product file.
I don't know of anything that will synchronize the Run Configuration with the product file.

requires 'bundle org.eclipse.nebula.widgets.nattable 1.0.0' but it could not be found

I am building an eclipse product, which works perfectly in local. But while exporting the product for higher environment I am getting this error:
Cannot complete the install because one or more required items could not be found.
Software being installed: abc Product Application (AIX) 2.3.1.20130918 (abc.product 2.3.1.20130918)
Missing requirement: Management Plug-in 1.0.0.201702171527 (abc.management 1.0.0.201702171527) requires 'bundle org.eclipse.nebula.widgets.nattable 1.0.0' but it could not be found
Cannot satisfy dependency:
I could see the module but its not able to use it while export.
Could anyone please help me out? I am stuck
If your .product file is based on plug-ins you must list every plugin you require in 'Contents' tab. The 'Add Required' button should add most of the required plugins once you have added your own plugins.
All of the plugins must be available either in the workspace or in the current Target Platform.
If your .product file is based on features all the required plugins must be included in features that you list on the Contents tab.

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.

Dependencies of my RCP application are missing on my update site

I am creating an RCP application. I am planning to provide p2 update functionality.
For example there are 4 plugins: A,B,C,D
Plugin A and B represents the core functionality of my RCP application. I have created a feature with name com.myorg.feature.core. In-side the feature.xml, in the plugin tab I have added plugins A & B.
I am adding feature com.myorg.feature.core as a dependecy in the product file of my RCP applicaton. After that I export the RCP application using product file (here product is a feature based product).
Now I have created two more features.
com.myorg.feature.featureC
com.myorg.feature.featureD
As these are optional functionalities to my RCP application, I want user to chose, whether to install them or not. So user will chose the install new software option where this features will be list.
The problem I am facing is, these plugins C & D are using certain 3rd party libraries e.g. BIRT, NATTABLE. So each time, I build featureC or featureD, put it on the update site and I try to install them in my application, they show the dependency failures, like bundle missing: org.eclipse.birt.core
I go back to the feature.xml for featureC -> plugins tab -> add org.eclipse.birt.core and build feature again. But several times my RCP application failed to install with errors bundles missing.
Is there any mechanism where I can determine all the required bundle from start? Is is the right way to launch updates or new install-able units for my RCP application?
#Priank it is better to add all dependencies in plugins tab in feature.xml, this is only one time effort. You can compute required plugins from dependencies tab of feature.xml
To me, the first question should be if you really want to use the Eclipse PDE export wizards for delivering updates.
Instead, you should set up a headless build for your project. If you are familiar with the PDE (and don't happen to hate Maven ;-), Tycho is probably the right choice for you. (Disclaimer: I'm committer on the Tycho project, and may not know all potential alternatives.)
You can easily make Tycho include all the transitive dependencies in a p2 repository: Just set the option includeAllDependencies to true on the tycho-p2-repository-plugin.

Eclipse "Installed Software" feature hierarchy in a product built by Tycho

I am building a feature-based product with Tycho. The build passes and the product works fine. Now I want to update a feature via my p2 update-site, but this is not working.
What I noticed is that when I click on Help -> About -> Installation Details, I see the product name as root element and all my features as children. So I'm not able to uninstall any feature and/or update them. Only the root element can be uninstalled. And I obviously don't want to do this because this is the whole product.
When I bring up the installation details dialog in my Eclipse IDE, I see all installed features as root elements. So I can uninstall or update individual features (e.g. EMF, Subversive, EGit).
So why is this different in the product built by Tycho? Why are my features not also top level elements in the installation?
I have tried to activate the checkbox This feature requires exclusive installation for my feature that I want to update, but this didn't helped.
Actually, not all features in your Eclipse IDE are installed on root level. There will also be a product element (e.g. "Eclipse SDK") and that product contains features which can not be updated or uninstalled independent of the product.
Still, you are having a valid point: How can feature be installed as root elements with Tycho so that they can be uninstalled or updated independently of the product?
This is possible since Tycho 0.20.0: You can specify in the product file if you want a feature to be installed as child element of the product, or if the feature shall be installed as root element. For the latter, you need to add an attribute installMode="root".
Example snippet from a *.product file:
<features>
<feature id="product-child-element-feature"/>
<feature id="root-element-feature" installMode="root"/>
</features>