问题
I have a eclipse 4 application project with a plug-in based product configuration. All necessary plugins are added into the dependencies tab on the .product file & generating a run configuration out of this .product file works flawless. But when exporting the .product as eclipse product, it's not working - the cause it probably, that the wrong versions from a few plugins are exported.
The error log contains messages like this:
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.e4.ui.css.swt [24]
Unresolved requirement: Require-Bundle: org.eclipse.e4.ui.css.core; bundle-version="0.9.0"
-> Bundle-SymbolicName: org.eclipse.e4.ui.css.core; bundle-version="0.11.0.v20150511-1937"; singleton:="true"
org.eclipse.e4.ui.css.core [23]
Unresolved requirement: Require-Bundle: org.apache.batik.css; bundle-version="1.7.0"
at org.eclipse.osgi.container.Module.start(Module.java:434)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
The problem is, that in the /plugins/ folder I have only v1.6.0 of org.apache.batik.css and whatever I tried, I can't get eclipse to export v1.7.0 (but in the run configuration itself, I can see that 1.7.0 is used).
I tried use the "Properties..." Button on the Dependencies tab and specify 1.7.0 as version number - but didn't worked either (there is a small red mark then next to the dependencies, but no error displayed - behavior in exported product stays same).
Is there anything I'm doing wrong here? How can I control the exported plugin version?
回答1:
After trying out all possible combinations, I've finally found the mistake why it didn't worked in the first place:
It's not enough to specify just the version number on the dependencies tab, but also the timestamp when the plugin was build exactly is necessary. So instead of 1.7.0 I had to specify 1.7.0.v20101104133 (exactly as displayed in the run-configuration as well). This solved the problem and the export was finally using same plugin version as the run-configuration.
回答2:
I got the same problem, but I found the other probably solution for this problem.
If the "Generate p2 repository" is cheched when exporting the product.
Then there are many plug-ins with different version will be exproted, and the problem is solved althrough I still donnot know why it is.
来源:https://stackoverflow.com/questions/31666311/eclipse-rcp-wrong-plugin-version-gets-exported