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

Enable OSGi support #66

Merged
merged 2 commits into from May 28, 2018

Conversation

Projects
None yet
2 participants
@io7m
Contributor

io7m commented May 23, 2018

This adds the relevant plugin configurations to make ode4j compatible
with the OSGi module system [0]. These are solely updates to the Jar
file manifests and therefore pose no compatibility issues. Manifest
generation is achieved via the bnd-maven-plugin [1] due to this plugin
having slightly better support across all of the major IDEs than other
plugins such as the maven-bundle-plugin [2].

In the process, it removes a couple of spurious compiler executions
from submodules.

[0] https://en.wikipedia.org/wiki/OSGi
[1] https://github.com/bndtools/bnd/tree/master/maven/bnd-maven-plugin
[2] https://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html

io7m added some commits May 23, 2018

Enable OSGi support
This adds the relevant plugin configurations to make ode4j compatible
with the OSGi module system [0]. These are solely updates to the Jar
file manifests and therefore pose no compatibility issues. Manifest
generation is achieved via the bnd-maven-plugin [1] due to this plugin
having slightly better support across all of the major IDEs than other
plugins such as the maven-bundle-plugin [2].

In the process, it removes a couple of spurious compiler executions
from submodules.

[0] https://en.wikipedia.org/wiki/OSGi
[1] https://github.com/bndtools/bnd/tree/master/maven/bnd-maven-plugin
[2] https://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html
Use a slightly older bnd-maven-plugin
The current version of the bnd-maven-plugin requires Java 8, and
ode4j must still build on Java 7.
@io7m

This comment has been minimized.

Contributor

io7m commented May 23, 2018

I've verified that this does build on JDK 7, and produces JDK 7 bytecode as it did before. OSGi support is purely metadata in the jar manifests, so there's no risk of compatibility issues as there were with the JPMS module data.

@io7m

This comment has been minimized.

Contributor

io7m commented May 23, 2018

A bit of background: OSGi was arguably the original module system for Java. The current Java 9 module system is inspired by it, but is severely restricted in functionality compared to OSGi. OSGi supports everything that the JPMS supports, but also supports proper module versioning (including being able to load multiple versions of the same module in the same JVM instance), dynamic loading and unloading of modules at runtime, APIs for fetching modules from remote servers, etc, etc, etc.

Some of the people involved in the design of OSGi were also involved in the design of the JPMS, and weren't exactly satisfied with the final design of the JPMS. OSGi is still actively developed and widely deployed (Eclipse is probably one of the best-known applications based on OSGi).

@tzaeschke tzaeschke merged commit 7bf670d into tzaeschke:master May 28, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tzaeschke

This comment has been minimized.

Owner

tzaeschke commented May 28, 2018

Great, thanks! Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment