Rcp 4 feature how to use different versions of same plugin from different update sites - eclipse-rcp

My company has a featured based RCP 4 app. We use tycho to build the app with a predefined target platform. There are several plugins that are retrieved from separate p2 update sites that have different versions of the same plugin that are both needed for our app to run. However, it appears that Eclipse only picks up the latest version of the plugin when the code is executed so my app fails to run properly.
I considered an article that had a similar problem, but the solution seemed to only deal with the issue where the plugins were defined in a dependency feature, not retrieved from a separate update site.
I've already tried including both versions of the plugins in the feature.xml with the correct "version=" value for each, but still only the latest version is used. What I want to know is how to get Eclipse to include both versions of the same plugin from the feature definition when the product is excecuted?

Related

Chained dependency order in Eclipse CDT

I'm attempting to utilize the "Project References" feature in Eclipse for an embedded firmware project. I'm using Code Composer Studio 7.0 which is essentially just a wrapper for Eclipse 4.6 with CDT 9.0 and JRE 8. However, from what I can tell the features I'm trying to use are specific to the CDT. The embedded firmware is broken up into several parts with a few libraries, an RTOS platform, and the "core" firmware.
The intention is that the dependencies of a project are automatically built and updated in the proper order whenever a build on the core firmware project is triggered. However, due to some libraries building upon others I'm seeing some weird behavior that i don't quite understand. The dependency graph is shown below.
As you can see, there's a maximum of four levels of dependency. The issue that I'm seeing is that, while I've ordered the references in the order "Properties->C/C++ General->Paths and Symbols->References" as [Platform, PAL, HAL, Features] for the firmware project, the build order doesn't seem to follow that specification. The ordering seems to be semi-random. After a clean sometimes the PAL will build first, other times the Features will. The entire build ultimately fails when this happens due to dependencies not being accessible. Is there an additional step I'm missing to get dependencies to build in the correct order, or are nested dependencies not supported by Eclipse for some reason?

Eclipse bundle version tolerances

I'm trying to install an Eclipse Product into an existing Eclipse installation using a third-party-tool (namely the IBM Installation Manager) but it fails with several errors of the kind
CRIMA1054E: Installing bundle "org.eclipse.equinox.p2.repository.tools_2.0.1.R36x_v20100823" into this existing Eclipse installation does not meet the version tolerance of "[2.0.100,3.0.0)" for the existing bundle "org.eclipse.pde.ui"
Unfortunately, I can't disclose any specifics on the affected product, so I'd like to turn this into a more general question.
Following some research on the Eclipse platform, my understanding is that it is one of the key features of the OSGi Specification, that one should be able install multiple versions of the same bundle (≘ plugin?) into the same environment. If the bundle org.eclipse.pde.ui is already present, I assume that also its required version of the [...].p2.repository.tools is already available.
My question: Why should it be a problem to just add another version of that plugin to the environment? Am I getting something terribly wrong about Eclipse and OSGi?
Side question: Shouldn't version 2.0.1.R36[...] be inside [2.0.100,3.0.0) anyway? Doesn't really affect my main question though, because I have other examples that are clearly out of tolerance.
Some initial thoughts and theories
Even though Eclipse allows parallel versions of a plugin, some plugins still conflict with other versions of themselves. Still, then I would expect more of an error like "[...].repository.tools_x is incompatible with [...].repository.tools_y which is required by existing bundle org.eclipse.pde.ui"
The installation is not blocked by Eclipse but by the IBM Installation Manager. It probably does some internal dependency checking but is too lazy to consider parallel bundle version installs.
Again regarding that specific product: Unfortunately the product is not available through the regular Eclipse software installation mechanism. I also would like to avoid dropping it into my Eclipse manually because I'm dependent on regular updates and those are only delivered through the IBM Installation Manager.
Any Eclipse plug-ins that contribute UI must have the singleton directive set to true. This means that only one bundle with that symbolic name can be in the framework, see http://wiki.osgi.org/wiki/Bundle-SymbolicName for more info.
I went and inspected the org.eclipse.equinox.p2.repository.tools bundle in my version of Eclipse (3.8), and I can see that it does indeed have singleton=true.
You said: "2.0.1.R36[...] be inside [2.0.100,3.0.0)"
That's not the case, as 2.0.1 is < 2.0.100.

Eclipse EGit and GWT/GAE

I have a central GIT repository, so that i can work on the project from different computers.
However when i pull the project on the other computer i get the error "Unbound classpath container: 'GWT SDK [missing]' in project 'Test Project'" (I also get a similar error for GAE).
So my question is: How do i setup my project so the same version of GAE/GWT is used on all computers.
I suspect the problem could be caused by the different versions of GAE and GWT on the machines. For example: GWT (1) is not the same version on the machines as it depends on when you updated GWT.
I ran into this problem too, and solved it by installing the GAE and GWT sdks under specific names, manually. That is, instead of relying on eclipse's software update tools, I downloaded the specific SDK version I wanted from the googlecode sites, and then added them manually to eclipse. This way their names include the numbers, and your git repository can store information about which versions it's using.
I do have to install the sdks manually on each developer machine, which is a drag.
To install an sdk manually:
Download it
Right-click on the sdk container in eclipse (in project explorer, it probably says GWT SDK [missing])
Choose properties
Click configure SDKs
follow the path to install a new sdk
You don't have to set the new sdk as default or anything - your project will pick it up immediately after you install it.
Note to any GPE developers: it'd be nice if the sdks were installed automatically with a version-specific name for the benefit of source control!
You can Change the project's SDK target.
In eclipse go to Marker [it is a tab next on the extreme left of the tabs including Console and Development] --> Left Click problem indication --> Click Quick fixes and choose the option which re-configures the project. This should fix the problem. Note that if your code uses features that changed between SDK versions you will have to make changes.
Combined with Rilev Lark's answer This is a chance to Update your projects or your environments whenever the problem occurs.

Eclipse Plugin Version Mismatch Issue

We have been having an interesting issue with the Eclipse update when some of our users update our feature/plugin to the latest release. Please see screenshot attached.
We have observed that in some cases the feature updates (and shows in the about dialog) the correct version number but when we take a look at the plugin details some of the plugins show the correct version but some of them still show the older version numbers even when the latest jars are in the plugins folder. Does anyone know why this would happen and how can we avoid this. This behavior is not consistent in all installation but we have seen it happening in Eclipse 3.5.
Will appreciate any help.
The only thing that I can think of is that some of your plugins are not contained in your feature, but are dependent on plugins that are included in the feature.
Eg- Feature A v1.0.0.x contains Plugin 1 v1.0.0.x and plugin 1 depends on plugin 2 with no version constraints.
If you have A v1.0.0.x, 1 v1.0.0.x and 2 v1.0.0.x installed, and upgrade A to v1.1.0.x, 1 will be upgraded to v1.1.0.x, but 2 will be left unchanged.
So, the thing to check here is to make sure that when you install your product, all plugins that are installed are contained inside of a feature. And, when you perform an update, all of the features are updated together.

Is there a way in Eclipse to find out plugins that are not used?

I am struggling with this!
While trying to install some features - eclipse keeps complaining about some dependency not met and about old version of some dependencies. The messages are rather not straigtforward.
Is there a way to clean the eclipse installation of the unused plugins? Does eclipse tell you on its own as to which features/plugins have not been used (for a while)?
What would be the definition of an unused plugin? All plugins that Eclipse update manager is referencing are currently in use because they were installed directly or are referenced by plugins that were installed directly.
I am not aware of anything that would actively track which features you are utilizing while using Eclipse and then report on unneeded plugins.
The error that you are running into typically happens because plugin A that you have depends on plugin X v1 and you are trying to install plugin B that requires X v2. Since both v1 and v2 of X cannot be simultaneously installed, installation of B aborts.
Here are the two most common causes of users finding themselves in this situation:
You haven't run "search for updates" recently, so many of your plugins are on older service levels. The plugin you are installing, however, requires a newer service level of a particular plugin. Resolve by updating your installation prior to trying to install the new plugin.
The plugin you are trying to install was not designed to be compatible with the major version of Eclipse that you are running. For instance, you might be running Eclipse "Galileo" 3.5 platform while the plugin you are trying to install was designed to work with Eclipse "Helios" 3.6 platform. You cannot use the update manager to move between major releases. Pay attention to what yearly release the plugin advertises support for. If it needs a newer version and you are willing to upgrade, you will need to download a new package.
Outside of that, post a new question with specific failure message you are getting along with details about your current installation and what you are trying to install. Someone here ought to be able to translate the installation failure into resolution options for you.