E4 Application - importing plugins without Bundle-SymbolicName - eclipse

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.

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 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!

Eclipse feature based launch unable to resolve dependency

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.

How Eclipse check available plugin in some environment?

I made some Eclipse plugin and update site on Indigo(Eclipse v3.7).
I can debug my plugin with new Eclipse instance, but I can't install my plugin via update site.
When I try to test install my plugin with Indigo (same environment as dev environment), the install wizard says:
Cannot complete the install because some dependencies are not satisfiable
com.mytest.helloworld.feature.group [1.0.0.201203071543] cannot be installed in this environment because its filter is not applicable.
(I tried to install my plugin with the same version of eclipse - Indigo.
And, My plugin works fine after manual install.)
Is there any check point to solve this?
How eclipse check available plugin? (based on what information?)
Here is my features.xml.
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="com.mytest.helloworld"
label="mytest Feature"
version="1.0.0.qualifier"
provider-name="mytest.com"
plugin="com.mytest.helloworld"
os="aix,hpux,linux,macosx,qnx,solaris,win32"
ws="carbon,cocoa,gtk,motif,photon,win32,wpf"
nl="en,ko"
arch="ia64,ia64_32,PA_RISC,ppc,sparc,x86,x86_64">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</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>
<url>
<update label="mytest update" url="http://localhost:8088/plugin"/>
</url>
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.core.expressions" version="3.4.101" match="greaterOrEqual"/>
<import plugin="com.android.ide.eclipse.adt" version="0.9.5" match="greaterOrEqual"/>
<import plugin="org.jdom" version="1.1.1" match="greaterOrEqual"/>
<import plugin="org.apache.commons.httpclient" version="3.1.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.core" version="3.5.2" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.resources" version="3.5.2" match="greaterOrEqual"/>
</requires>
<plugin
id="com.mytest.helloworld"
os="aix,hpux,linux,macosx,qnx,solaris,win32"
ws="carbon,cocoa,gtk,motif,photon,win32,wpf"
nl="en,ko"
arch="ia64,ia64_32,PA_RISC,ppc,sparc,x86,x86_64"
download-size="1000"
install-size="1000"
version="0.0.0"
unpack="false"/>
<plugin
id="com.mytest.helloworld.nl1"
os="aix,hpux,linux,macosx,qnx,solaris,win32"
ws="carbon,cocoa,gtk,motif,photon,win32,wpf"
nl="en,ko"
arch="ia64,ia64_32,PA_RISC,ppc,sparc,x86,x86_64"
download-size="1"
install-size="1"
version="0.0.0"
fragment="true"
unpack="false"/>
</feature>
Have you been able to run the plugin in a new Eclipse instance from your development environment? I.e press the run button and start a new Eclipse application with your plugin active.
It seems like there is some issue with filters, either you have defined a version requirement that doesnt work, or perhaps defined an OS that doesnt work. Posting your feature.xml might help.
Edit based on comment:
Try to remove the OS specific parts from the XML, i.e the properties "os", "ws", "arch" and perhaps "nl".
You would get
<feature
id="com.mytest.helloworld"
label="mytest Feature"
version="1.0.0.qualifier"
provider-name="mytest.com"
plugin="com.mytest.helloworld">
You only need to enter those properties if you are restricting the choice in some way, that is, your plugin contains OS specific code that will only work on some operating systems/architectures.