RCP P2 Update for base productin - eclipse-rcp

I am developing an RCP P2 update.
I created RCP Mail Template application. (com.project.app.mail)
I added product configuration file MailProduct.product
I added org.eclipse.equinox.p2.ui.sdk as a dependency in the dependency tab if my plugin project. After adding this, I got Intall New Software and Check for Update options under the help menu.
I added p2.inf file with following content.
instructions.configure=\
addRepository(type:0,location:http${#58}//localhost:8080/REPO/);\
addRepository(type:1,location:http${#58}//localhost:8080/REPO/);
I converter a product to feature based product.
I created a feature project (com.project.feature.mail)
I added com.project.app.mail in the plugin tab of feature com.project.feature.mail
I launched RCP product via product file. As it failed, I went to run configuration, added required plugin. Application launched successfully after that.
I exported the product. Exported product worked fine.
Now I made some changes to com.project.app.mail.
Updated com.project.feature.mail verstion to 1.0.100.quailfier (earlier version 1.0.0.quialifier)
Added an update site project. Added category with id com.project.category.mail. Added mail feature with version 1.0.100.qualifier.
Clicked on build all, moved generated features, plugin, artifact and repository.xml to a local http server (tomcat)
I tried to update the com.project.feature.mail via, check for update option.
It says no update found, while the install new software page shows the updated com.project.feature.mail with updated versio. In proceeding ahead with installation, it tells only update is possible while update cannot find the new update.
Kindly guild me how provide update for base product.
If you need any other infomation do let me know.

Dear Priyank what is your product(MailProduct.product) version?
Following suggestions will solve your problem.
You have to change MailProduct.product version too.
Re-export your product with Generate Metadata Repository option.
Use this Repository on your Web-Server to get updates.
With Update Site Project software updates not work so easily.

Related

Error while trying to update p2 site with Buckminster

I am really new in buckminster.
I have just downloaded from our repository an Eclipse RCP project that needs a plugin update (placed in its Target Platform). We are currently using a remote target platform.
I have downloaded the remote target platform configuring its path in the targetplatform.source project, then I did the update and reload it checking the plugin's version. I have changed the version number in feature.xml on my targetplatform.feature project (that contains the buckminster.properties file).
The problem comes when I right-click on the targetplatform.feature project, select Buckminster > Invoke action... > site.p2. This just rise an error and the console shows the Buckminster log with the same error:
java.lang.IllegalArgumentException: case variants of key: awt.toolkit: case variants of key: awt.toolkit
Thanks in advance!
Best regards,
I finally had to stop using a remote target platform as I could not solve the Buckminster problem. The workaround described below covered my plugin update needs.
In order to have a control version system, the plugin update problem can be managed by having a repository manager (for example Nexus). Then you can simply upload a zip of your target platform with the updated plugins. Nevertheless, this forces the configuration to set the target platfom as local and therefore you need to download and unzip it previously.

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.

Repackage update site into one feature

I have an update site that contains some 100 - 200 features and many more plugins. For some users all of these are needed, so I'd like to simplify the installation process by creating one feature that they can install. This feature would then contain all the contents of the update site.
I've created a new feature project and my plan is to add the contents of the original update site as included features and plugins in this project.
Problems is; In my feature project, when adding feature in the "included features" tab, I can only add features that are currently installed in my Eclipse platform. I'd rather not install those 200 features just so I can add them.
Is there a way to work around this?
Without the features installed in your target platform, you will need to edit the feature.xml file directly. All you need to do is to add the following for each feature that you want to include:
<includes
id="<add_feature_id>"
version="0.0.0"/>
Your build process (PDE or tycho) should add the proper version numbers for you.
I think you should have a detailed look at the Eclipse target platform concept. The features don't need to be installed in your current Eclipse platform (i.e. the IDE), they need to be installed in the target platform to be available for an update site.
If you never defined a target platform, your currently running application will be taken as IDE, and that is where your confusion might come from.
When I try to manipulate a feature I only need to have them in my workspace. No reason to install them.

Eclipse: Include required features to update site

I am developing an Eclipse plug-in that requires a third-party plug-in such as the AJDT (AspectJ Development Tools) plug-in.
When a user wants to install my plug-in from the update site and does not have AJDT installed or enabled in his list of available update sites the installation will fail.
I created a file associateSites.xml next to the site.xml and included the reference in site.xml: tag:
<site
associateSitesURL="associateSites.xml">
The content of associateSites.xml looks like this:
<associateSites>
<associateSite url="..."/>
</associateSites>
This does not seem to have the wanted effect. Is there any other way to do so?
Using associateSitesURL seems to be deprecated.
This can help:
Include an external update site in my update site in Eclipse
together with
Feature Export Wizard
You have to add the
<repository-reference location=...>
tag in the category.xml and export the features as described in Feature Export Wizard, checking the option "Categorize repository".
Try making the associateSitesURL an absolute URL (eg, http://www.yourdomain.com/updates/associateSites.xml)

Change Eclipse default update repository list

I am trying to deploy a version of Eclipse and would like control over the default repository list. See my earlier question.
In my other question, I learned that this is stored in the user's home directory under ".eclipse\org.eclipse.platform_3.7.0_525061626\p2\org.eclipse.equinox.p2.engine\profileRegistry\epp.package.cpp.profile\.data\.settings\org.eclipse.equinox.p2.metadata.repository.prefs".
I would rather not deploy this file to a user specific location because there might already be one from another Eclipse installation and there could be more than one user account.
Is there any way that I can avoid the user profile?
I did find an equivelent file under the main Eclipse folder "eclipse\p2\org.eclipse.equinox.p2.engine\profileRegistry\epp.package.cpp.profile\.data\.settings\org.eclipse.equinox.p2.metadata.repository.prefs" but changing this didn't make any difference.
Thanks,
Alan
You can use p2 touchpoints and the p2 director to install your feature to customize the version of eclipse you are trying to deploy.
See p2.inf for an example of touchpoint configuration instructions that add p2 repositories to the default install. This one is part of an sdk.product generation. If you are starting with an eclipse that already has a product, your touchpoint instructions would have to remove the repositories that were already included and then add your own.
instructions.configure=\
addRepository(type:0,location:http${#58}//download.eclipse.org/eclipse/updates/3.8,name:The Eclipse Project Updates);\
addRepository(type:1,location:http${#58}//download.eclipse.org/eclipse/updates/3.8,name:The Eclipse Project Updates);\
addRepository(type:0,location:http${#58}//download.eclipse.org/releases/juno,name:Juno);\
addRepository(type:1,location:http${#58}//download.eclipse.org/releases/juno,name:Juno);
The way that I ended up doing this was to create a lightweight plugin that starts when Eclipse loads. This then programatically adds the update site as detailed here: https://stackoverflow.com/a/7384954/101642