Status.ERROR,
PLUGIN_ID,
"Unable to find any Apache Felix main bundle (org.apache.felix.main) in the workspace or the Target Platform."));
// Find the selected apache felix bundle version
Version targetVersion = findTargetApacheFelixVersion(configuration);
IPluginModelBase apacheFelixBundle = null;
if (targetVersion != null) {
for (int i = 0; i < apacheFelixBundles.length; i++) {
if (apacheFelixBundles[i].getBundleDescription().getVersion()
.equals(targetVersion)) {
apacheFelixBundle = apacheFelixBundles[i];
break;
}
}
if (apacheFelixBundle == null) {
throw new CoreException(
new Status(
Status.ERROR,
PLUGIN_ID,
"Could not find bundle location for selected Apache Felix Main version "
+ targetVersion
+ " among Apache Felix Main bundles found in target platform "
+ Arrays.toString(apacheFelixBundles)));
}
} else {
apacheFelixBundle = apacheFelixBundles[0];
}
if (apacheFelixBundle.getInstallLocation() == null)
throw new CoreException(
new Status(
Status.ERROR,
PLUGIN_ID,
"Found Felix plugin in workspace, but unable to find its corresponding JAR file."));
classpath.add(apacheFelixBundle.getInstallLocation());
Version felixBundleVersion = apacheFelixBundle.getBundleDescription()
.getVersion();
int major = felixBundleVersion.getMajor();
int minor = felixBundleVersion.getMinor();
Collection<String> felix42LauncherClasspath = calculateNeededClassPath(LAUNCHER_PLUGIN_ID_FELIX42);
Collection<String> legacyLauncherClasspath = calculateNeededClassPath(LAUNCHER_PLUGIN_ID_LEGACY);