Closed tcalmant closed 1 year ago
@randallwhitman Could you review?
Hi @tcalmant - thanks for offering this contribution. Can you please explain a bit the objective of adding this to geometry-api-java - thanks in advance.
Hi @randallwhitman
This addition generates the Import-Package
and Export-Package
entries in the MANIFEST.MF
of the library's JAR file.
This allows it to be considered an OSGi bundle and to be installed/used in an OSGi application by other bundles.
Without those metadata, other bundles can't load classes from the library as they are considered private by default.
Here is the specification of OSGi: https://docs.osgi.org/specification/osgi.core/8.0.0/framework.introduction.html
Thanks. Will it require any changes to applications not using the OSGi framework?
No changes required for other applications.
The annotations added in the package-info.java
files, Export and Version, are of CLASS retention policy, which means they are accessible reading the .class
file directly, but are not loaded at runtime and therefore don't require new runtime libraries.
Note that it is useful to update the Version
annotations when updating the library, as it allows the OSGi applications to know if they are compatible with a given JAR file.
OK, sounds reasonable, thanks.
@tcalmant Thakn you for contribution. @randallwhitman Thank you for review.
Hi,
This PR adds the generation of OSGi metadata in the Manifest file. Added dependency is only declaring annotations, i.e. it doesn't add a runtime requirement.