Eclipse feature based launch unable to resolve dependency - eclipse

I have an OSGI bundle that depends on a package, which is exposed through a feature. The
package I depend on requires a specific version of a bundle, say com.company.antlr.runtime (3.0.1). The feature in turn packages two versions of the bundle, com.company.antlr.runtime (3.0.1) and com.company.antlr.runtime (3.2.0).
The problem is that when I make a feature based launch configuration in Eclipse with my bundle (in a feature) and the feature containing the package I depend on, I get a missing constraint
validation error stating that the required bundle com.company.antlr.runtime(3.0.1) is
missing.
Adding com.company.antlr.runtime (3.0.1) as a bundle to the feature launch has no effect, I still get the same validation error.
If, on the other hand, I make a bundle based launch configuration including the exact same
bundles as those packaged in the feature there is no validation problem.
The problem can be illustrated with this minimal example:
The bundle org.example.examplebundle has the manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name:Examplebundle
Bundle-SymbolicName: org.example.examplebundle
Bundle-Version:1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: com.company.antlr.runtime;bundle-version="[3.0.1,3.0.1]"
And the feature org.example.examplefeature has the feature.xml:
<feature
id="org.example.examplefeature"
label="Examplefeature"
version="1.0.0.qualifier">
<plugin
id="org.eclipse.osgi"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.example.examplebundle"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.company.antlr.runtime"
download-size="0"
install-size="0"
version="3.0.1"
unpack="false"/>
<plugin
id="com.company.antlr.runtime"
download-size="0"
install-size="0"
version="3.2.0"
unpack="false"/>
</feature>
Making a feature based launch with just this feature will lead to the validation error.
Making a bundle based launch with the four bundles included in the feature does NOT give a validation error.
I then tried adding the necessary bundles for using the console and removing the bundle org.example.examplebundle from the feature org.example.examplefeature and then running it using the feature based launch. I then observed that the bundle com.company.antlr.runtime (3.0.1) was not started at all.
If I add the same necessary bundles to the bundle based launch I can observe that both com.company.antlr.runtime (3.0.1) and com.company.antlr.runtime (3.2.0) are active.
My guess based on this is that the resolver for the feature based launch concludes that the bundle with the highest
version number is sufficient, and therefore doesn't start the older version at all.
With that hypothesis in mind, I tried to state explicitly in the feature.xml that I need a perfect match
for com.company.antlr.runtime (3.0.1) by including the following snippet in the feature.xml:
<requires>
<import
plugin="com.company.antlr.runtime"
version="3.0.1"
match="perfect"
/>
</requires>
But, alas, to no avail.
So, my question now is: is there any way to solve this problem while keeping the feature based launch?
For completeness: I am running Eclipse Kepler 4.3 and OSGI 3.8.1

it seems that you are setting the auto-start to true for the two bundles when using Bundle based launcher.
You can't do the same when using Feature based launcher unless you have set "Default Auto-Start" true or create a Product definition and set a start level for those bundles.

Related

How do I get the CVS plugin working in Eclipse 2021-09?

I have an Eclipse 2021-09 install on a RHEL8 machine without Internet access.
Therefore I have downloaded the CVS jar org.eclipse.cvs_1.4.1900.v20210906-0500.jar on an other machine and then copied it into the dropins directory of my RHEL8 Eclipse install. After this I started the Eclipse IDE and now I can see that CVS plugin in Eclipse's list of plugins.
So far so good. But when I try to import a CVS project (via File > Import) I cannot see an CVS import option. Nowhere else I can see anything about the CVS plugin either.
How do I get the CVS plugin working in Eclipse 2021-09?
More Details:
Eclipse writes the follwoing messages to stdout/stderr:
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /home/halloleo/eclipse-workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.16.1.20210603-1006.xml
org.eclipse.m2e.logback.configuration: Initializing logback
That plug-in on its own only contains a small part of the CVS code. The CVS feature.xml for 2021-09 contains:
<plugin
id="org.eclipse.cvs"
download-size="30"
install-size="40"
version="1.4.1900.v20210906-0500"
unpack="false"/>
<plugin
id="org.eclipse.team.cvs.core"
download-size="577"
install-size="1343"
version="3.5.0.v20210511-0556"
unpack="false"/>
<plugin
id="org.eclipse.team.cvs.ssh2"
download-size="30"
install-size="57"
version="3.4.0.v20210426-0837"
unpack="false"/>
<plugin
id="org.eclipse.team.cvs.ui"
download-size="1527"
install-size="3495"
version="3.5.0.v20210426-0843"
unpack="false"/>
So you need all those plug-ins.

Eclipse EMF RAP Target Components

Good day all,
I am attempting to get an Eclipse RAP application running with EMF support. Following the steps from the Eclipse wiki (https://wiki.eclipse.org/RAP/EMF_Integration) as closely as possible (it's dated four years ago), I am putting the following packages into my Target definition:
EMF RAP Target Components
RAP Basic Equinox Target
RAP Runtime
This gives me the following Target definition:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="SCRAMSTargetDefinition" sequenceNumber="17">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.emf.rap.sdk.feature.group" version="2.13.0.v20170609-0928"/>
<unit id="org.eclipse.rap.equinox.target.feature.feature.group" version="3.2.0.20170613-1148"/>
<unit id="org.eclipse.rap.feature.feature.group" version="3.2.0.20170609-1144"/>
<repository location="http://download.eclipse.org/releases/oxygen/"/>
</location>
</locations>
</target>
The Target will not resolve though, giving me the following dependency errors:
Problems occurred while resolving the target contents
Cannot complete the install because one or more required items could not be found.
Cannot satisfy dependency:
From: EMF RAP Runtime 2.13.0.v20170609-0928 (org.eclipse.emf.rap.feature.group 2.13.0.v20170609-0928)
To: org.eclipse.emf.rap.edit.ui.feature.group [2.9.0.v20170609-0928]
Cannot satisfy dependency:
From: EMF RAP Target Components 2.13.0.v20170609-0928 (org.eclipse.emf.rap.sdk.feature.group 2.13.v20170609-0928)
To: org.eclipse.emf.rap.feature.group [2.13.0.v20170609-0928]
Missing requirement: EMF RAP Edit UI 2.9.0.v20170609-0928 (org.eclipse.emf.rap.edit.ui.feature.group 2.9.0.v20170609-0928) requires 'A.PDE.Target.Platform Cannot be installed into the IDE 0.0.0' but it could not be found
Software being installed: EMF RAP Target Components 2.13.0.v20170609-0928 (org.eclipse.emf.rap.sdk.feature.group 2.13.0.v20170609-0928)
Buried in there is A.PDE.Target.Platform Cannot be installed into the IDE 0.0.0, which would seem to be the core problem - but this is a Target Definition, not the IDE itself, so I'm not understanding why it's complaining in this way.
I have tried including combinations of other EMF packages into the Target Definition, but nothing has helped. Any guidance would be appreciated.
I found the answer in the Eclipse Forums:
When adding the update site to the target definition, the Include required software option has to be disabled. This is equivalent to switching includeMode from planner to slicer. In addition to that, you might want to enable the Include all environments option (set includeAllPlatforms to true).
Please note that these settings have to be the same for all locations (if the target definition includes more than one location / update site).

E4 Application - importing plugins without Bundle-SymbolicName

I am working on an project which is a POM and manifest driven E4 application containing a plugin platform project which builds a local p2 as my target for the larger RCP app. A necessary dependency is older and has within its jar a manifest which contains no Bundle-SymbolicName. As such, I am unable to import the plugin to my local p2 repo and subsequent target definition, since the feature.xml of my platform project cannot resolve the plugin.
Is there any way in which to import this plugin to my local p2 without a Bundle-SymbolicName attributed to it?
Thanks
feature.xml
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="example.p2.feature"
label="Example Maven Dependencies"
version="1.0.0.qualifier"
provider-name="">
<description url="http://www.example.com/description">
Base feature for example project to be built on
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<plugin
id="org.apache.commons.collections"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.thrift"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.commons.pool"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: ecagent
Build-Jdk: 1.5.0_22
Created-By: Apache Maven 3.1.1
A jar which does not contain a Bundle-SymbolicName entry (and does not contain a plugin.xml in the old Eclipse 2.0 style) is not a plug-in and you can't reference it as though it was one.
You can either include the jar as part of one of your existing plug-ins (make sure it is listed in the `build.properties if you do this) or you can create a new plug-in just the contain the jar.

Eclipse RCP doesn't unpack jar

Eclipse has an option on features to unpack the jar file. This is not working for me.
When I check the box Unpack the plug-in archive after installation, the PDE tooling removes the unpack attribute completely from that jar. I have tried this configuration as well as changing it to unpack="true". Neither result in the jar being unpacked during build, installation or after running the executable.
Any suggestions on how to get the jar automatically unpacked?
Thanks for taking time to read my question!
Excerpt of feature.xml to unpack com.easa.motordb.services.remote
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="com.easa.motordb.feature"
label="Feature"
version="1.0.0.qualifier"
provider-name="EASA">
...
<plugin
id="com.easa.motordb.client.eclipse"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.easa.motordb.services.remote"
download-size="0"
install-size="0"
version="0.0.0"/>
</feature>
I had the same issue.
I checked the box Unpack the plug-in archive after installation in my feature.xml that includes plugin_1 and plugin_2, but after building my project the jar of plugin_2 still appears and was not unpacked.
I had a plugin_1 already where this unpacking works and by looking for differences between these two plugins I found something:
The MANIFEST.MF file from my working plugin_1 had an additional line which was missing in my other not working plugin_2:
Eclipse-BundleShape: dir
I just added this line to the MANIFEST.MF file of plugin_2 and the unpacking works as expected.

Plug-in reference 'com.my.plugin.source' cannot be resolved in feature.xml

I'm assembling a multi-module project to build a set of Eclipse plug-in (and a feature, an update site, etc.) with Tycho.
My issue is that for the source feature (the one that contains the source code of the plugin and can installed separately in addition to the plug-in) I have a warning in Eclipse:
Plug-in reference 'com.my.plugin.source' cannot be resolved in
feature.xml/com.my.plugin.source.feature
In the source feature.xml file I use the following definition:
<plugin
id="com.my.plugin.source"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
Any hints how can I resolve the warning? Thanks in advance!