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

Fully automate OSGi metadata creation and restore OSGi-metadata in remaining slf4j modules #340

Merged
merged 3 commits into from
Apr 9, 2023

Conversation

HannesWell
Copy link
Contributor

This is a follow-up of #324 and the reduced version of #327, that has not been covered in #330.

With this change the OSGi metadata of all remaining slf4j modules are generated using the maven-bundle-plugin.
This makes all remaining MANIFEST.MF files obsolete and they are therefore removed. Then sfl4j only has one source for OSGi metadata: the configuration of the maven-bundle-plugin. This simplifies the understanding how the metadata are crafted and maintenance on the long run, as requested in #331 (comment) and noted in SLF4J-583.

This also re-adds metadata that where accidentally removed in 2.0.6 and thus fixes SLF4J-578.
Additionally it improves the metadata by adding more use-clauses to more Export-Package entries.

@ceki can you please review this or let me know if you want to have this split up? I know you prefer smaller steps, but I didn't wanted to create one PR for each slf4j module and therefore made a bigger change. Nevertheless the single changes are now simpler compared to other PRs.
The PR is build in two steps. The first commit is dedicated to restore missing metadata and to remove entries from the manifest that are already generated by the m-bundle-plugin and are therefore duplicates. This already allowed to remove some Manifests entirely.
The second commit then replaces all remaining manifests by a corresponding configuration of the maven-bundle-plugin, so that no OSGi metadata are crafted from that. In order to simplify the generation of the OSGi Service Loader Mediator headers I created a profile that is activated by the existence of the file src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider and adds the corresponding manifest headers. The properties in the header are filled with values from the corresponding project.

Please let me know if you want a change or something is not clear.

@HannesWell HannesWell force-pushed the automate_remaining_osgi_metadata branch from 570e0d5 to ca0ba5b Compare March 18, 2023 15:14
@HannesWell HannesWell force-pushed the automate_remaining_osgi_metadata branch 3 times, most recently from 99b7aa7 to 86c16c2 Compare March 19, 2023 15:15
Only use the maven-bundle-plugin to generate all OSGi metadata into
slf4j's Manifest.MF files. This unifies the resulting MANIFEST.MFs
that are currently partly generated and partly statically defined and
fixes the following aspects:

- Fix the package-export of slf4j-jdk-platform-logging (from
'slf4j.jdk.platform.logging' to 'org.slf4j.jdk.platform.logging')
- Import missing packages for slf4j-reload4j and log4j-over-slf4j
- Replace the deprecated 'Bundle-RequiredExecutionEnvironment' by a
corresponding required 'osgi.ee' capability
- Restores the exported packages of jcl-over-slf4j

Fixes https://jira.qos.ch/browse/SLF4J-578

Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
This ensures that there is only a single source for OSGi metadata.
Additionally this improves the metadata for some Export-Package entries.

Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
@HannesWell HannesWell force-pushed the automate_remaining_osgi_metadata branch from 86c16c2 to da0a024 Compare April 9, 2023 19:36
The value of project.name is more expressive than the previously used
project.artifactId.

Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
@HannesWell HannesWell force-pushed the automate_remaining_osgi_metadata branch from da0a024 to 407bb8e Compare April 9, 2023 19:38
@ceki ceki merged commit 0b4d88e into qos-ch:master Apr 9, 2023
1 of 10 checks passed
@HannesWell HannesWell deleted the automate_remaining_osgi_metadata branch April 10, 2023 06:30
@HannesWell
Copy link
Contributor Author

Thank you Ceki for your review and merging this.
I checked the generated OSGi metadata again and they look much better now. 👍🏽

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.

None yet

2 participants