Max
Max

Reputation: 89

Equinox/OSGi/Eclipse plugin development: where do these dependencies come from and how do I specify their minimum versions?

I am developing an Eclipse plugin in Neon.1a and it is using library version too new for the target version (4.4.x Luna). The immediate failure when installing the plugin is at org.eclipse.core.filesystem which I use in my code to write text files to the file system. However, even if I specify a minimum of 1.4.0 it still resolves to 1.6.0 because of other implicit dependenies. How to I make my plugin compatible with older versions of Eclipse? Do I have to add the implicit plugins as dependencies and specify their minimum versions in the manifest?

MANIFEST.MF

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Workbench
Bundle-SymbolicName: workbench;singleton:=true
Bundle-Version: 1.0.0.beta
Require-Bundle: org.eclipse.core.runtime,
 org.eclipse.ui,
 org.eclipse.core.filesystem;bundle-version="1.4.0",
 org.apache.commons.io,
 org.apache.commons.lang
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .,
 swing2swt.jar
Import-Package: javax.xml.bind,
 org.apache.commons.io,
 org.eclipse.core.filesystem,
 org.eclipse.core.runtime,
 org.eclipse.datatools.connectivity,
 org.eclipse.swt,
 org.eclipse.ui,
 org.eclipse.ui.ide,
 org.osgi.framework
Bundle-Activator: Activator
Bundle-ActivationPolicy: lazy

Eclipse Dependency Hierarchy
Eclipse Dependency Hierarchy

Upvotes: 0

Views: 77

Answers (1)

greg-449
greg-449

Reputation: 111142

I think you are misinterpreting the views.

Your manifest is saying that you need at least version 1.4.0 of the org.eclipse.core.filesystem with any higher version being acceptable.

If your current target platform is Eclipse Neon this will match the 1.6.0 version of the plugin and that will be shown in the Plug-in Dependencies view. That does not mean that 1.6.0 is required, this view is just showing you what will be used in your current target platform.

If you want to test against Eclipse Luna create a Target Platform using Luna and test against that. Target Platforms are specified in the Preferences in 'Plug-in Development > Target Platform'. This lets you create code using the current Eclipse but test it against older versions.

Upvotes: 1

Related Questions