PDE OSGi bundles and Virgo tooling [message #1729645] |
Sat, 16 April 2016 21:28 |
|
I've been doing OSGi in eclipse for a while now and decided to try out Virgo as an application server.
The eclipse tooling was one of the things that really caught my eye, the thought of being able to do OSGi development the same way that I can do Servlet, JSP, etc., with publishing to a server was really appealing.
I falsely assumed that my current pallet of OSGi bundles would seamlessly integrate with the Virgo runtime using the provided tooling.
I'm used to define "OSGi Frameworks" and being able to simply select the bundles that I want to include, so eclipse obviously "knows" which "Plug-In projects" are OSGi compliant bundles.
When I deployed a few bundles to Virgo everything was getting messed up. Bundle version "0.0.0" everywhere, no classes being found etc..
It took me for ever to figure out that the Virgo tooling expects "META-INF/MANIFEST.MF" to be in a source directory and doesn't care about the PDE file. I thought I didn't understand either the tooling, Blueprints or Virgo.
You can imagine my surprise when I decided to try copying "META-INF/MANIFEST.MF" to the source directory and everything started working as I had expected it to from the beginning.
The PDE has "META-INF/MANIFEST.MF" in the root directory of the project and this is not configurable. Other bundles in the PDE look there for Required-Bundles and Exported-Packages and everything develops and runs "out of the box".
Why does there have to be an extra "org.eclipse.virgo.ide.facet.core.bundlenature" nature that describes the same thing anyway?
Would it be too much to ask for the Virgo tooling to check if the project has the "org.eclipse.pde.PluginNature" nature and then copy "META-INF/MANIFEST.MF"" from the project root when deploying? Maybe with a "org.eclipse.virgo.ide.facet.core.pdebundlenature" marker if it has to be a manual selection.
Doing this would present a unified use of OSGi bundles to us developers and the thought of being forced to have a redundant copy of "META-INF/MANIFEST.MF"" in a source directory just for Virgo deployment is an awful thought.
References:
Open bug since 2006 - Expose flexible bundle root location in bundle creation wizards: https://bugs.eclipse.org/bugs/show_bug.cgi?id=153023
Open bug since 2010 - Support PDE/Equinox bundles in Eclipse IDE: https://bugs.eclipse.org/bugs/show_bug.cgi?id=329198
|
|
|
|
Re: PDE OSGi bundles and Virgo tooling [message #1729657 is a reply to message #1729653] |
Sun, 17 April 2016 08:20 |
|
Hi GianMaria,
I didn't get as far as comment 50 but I'm using Mars (4.5.2) so I already have the snapshot installed.
The CheckBox is set in my server configuration, I've added the "OSGi Bundle Nature" and I've ran "Migrate PDE2Virgo Project".
The end result is the same, the MANIFEST.MF in the Project's /META-INF is ignored.
I didn't add one of the "OSGi Framework" run times because the platform has that many and I don't want them all in the Virgo server.
So the solution doesn't work for me.
I don't understand why is it should be so difficult to have the MANIFEST.MF taken from the PDE project's META-INF directory.
I found a workaround that gets the deploy working correctly. I've created a META-INF directory in SRC and then added a linked resource to the project's MANIFEST.MF.
.project then has this added:
<linkedResources>
<link>
<name>src/META-INF/MANIFEST.MF</name>
<type>1</type>
<locationURI>PROJECT_LOC/META-INF/MANIFEST.MF</locationURI>
</link>
</linkedResources>
This doesn't seem to break the release builds or my ant scripts as the file isn't physically copied.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03724 seconds