Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the project OSGi compatible #15

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Open

Make the project OSGi compatible #15

wants to merge 5 commits into from

Conversation

io7m
Copy link

@io7m io7m commented Dec 9, 2019

This set of commits makes the following changes:

  • All jar manifests are now generated using the Bnd tool. The new manifests contain a superset of the old manifests with the addition of OSGi headers. This is achieved by using .bnd files instead of raw .mf manifest files, with the bnd tool expanding properties inside the .bnd files to produce manifests which are then inserted into jar files directly.
  • The locale jars have manifest headers that allow them to act as "fragments". A fragment, in OSGi terms, more or less acts like an extension to an existing jar file. Primarily, this is used to introduce locale-specific string resources into an existing jar.
  • The existing BundleActivator class has essentially been eliminated; the class still exists but does nothing.

io7m added 5 commits October 21, 2019 14:52
This imports Bnd 4.3.0 and updates the build.xml script to produce
OSGi manifests for each produced jar file (except for derbyrun,
derbywar, and the locales jars).

Currently, no attempt is made to reproduce the old Class-Path
entries. These will be reconstructed when the locale jars have been
upgraded to fragments.

The Bundle-SymbolicName entries have been changed to match the JPMS
module names, for consistency.

Affects: https://issues.apache.org/jira/browse/DERBY-7056
This updates the build.xml script and Bnd configurations to add OSGi
manifests to locale jars. Currently, no attempt is made to actually
use these bundles, and no Class-Path entries have been added.

Affects: https://issues.apache.org/jira/browse/DERBY-7056
This adds Fragment-Host headers for bundles, and refactors the
build.xml file to improve the readability of the generation of bundles.

Affects: https://issues.apache.org/jira/browse/DERBY-7056
This adds Class-Path attributes compatible with the existing 10.15.1.3
manifest headers.

Affects: https://issues.apache.org/jira/browse/DERBY-7056
This removes the existing code from the BundleActivator, as per the
discussion on DERBY-7056.

Affects: https://issues.apache.org/jira/browse/DERBY-7056
Copy link

@laeubi laeubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to download tools/java/biz.aQute.bnd-4.3.0.jar instead of checking it into the version control?

*

Export-Package: \
org.apache.derby.agg, \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if an Export-Package: org.apache.derby.* would be sufficient here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for checking bnd into version control: I would normally never do this, but it seems that the project is already doing this for pretty much all of the build tools.

For Export-Package: If I remember correctly, there are packages that are not exported by the JPMS module definition. Exporting a package with OSGi that's not exported by the VM's module definition will result in trouble, won't it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, maybe there are reasons why these packages are omitted, it just feels a lot of maintenance need to keep them in sync, but maybe this is for historical reasons.
I think you are right about the checked in tools didn't noticed that, maybe it would be good to use https://ant.apache.org/ivy/ instead, but that's a little bit out of scope here.
Lets see what the maintainers think about this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, maybe there are reasons why these packages are omitted, it just feels a lot of maintenance need to keep them in sync

Yep. What I'm hoping is that the OSGi/Bnd people will come up with a way to calculate OSGi package exports from existing JPMS descriptors (if descriptors are present). This would eliminate the duplication.

@egonw
Copy link

egonw commented Jul 26, 2022

Having OSGi bundles would help our PathVisio project a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants