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

Fix OSGi metadata generation to work on JavaSE < 9 #1603

merged 3 commits into from Nov 4, 2019


Copy link

Fixes #1601 #1602

  • explicitly specifies Require-Capability: for 1.6 or greater to disable bnd's autogeneration which is deceived by the module-info.class file
  • drop the JavaSE 1.5 reference since it hasn't been true for years (Build Gson for Java 1.6. #790)
  • remove the unused org.apache.felix:maven-bundle-plugin plugin reference

Here are the differences in the resulting manifests:

--- gson-manifest-2.8.6	2019-10-31 12:24:51.000000000 -0400
+++ gson-manifest-2.8.7-SNAPSHOT	2019-10-31 11:49:39.000000000 -0400
@@ -1,23 +1,22 @@
 Manifest-Version: 1.0
 Archiver-Version: Plexus Archiver
-Created-By: 11.0.4 (Oracle Corporation)
-Built-By: inder
+Created-By: 11.0.4 (AdoptOpenJDK)
+Built-By: bsd
 Build-Jdk: 11.0.4
-Bnd-LastModified: 1570215293550
+Bnd-LastModified: 1572539070059
 Bundle-Description: Gson JSON library
 Bundle-ManifestVersion: 2
 Bundle-Name: Gson
-Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6, JavaSE-1.7, J
- avaSE-1.8
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7, JavaSE-1.8
 Bundle-Vendor: Google Gson Project
-Bundle-Version: 2.8.6
- .6",;version="2.8.6",;vers
- ion="2.8.6"
+ .7",;version="2.8.7",;vers
+ ion="2.8.7"
 Tool: Bnd-

Specifying disables bnd's auto-generated value which is determined from
the minimum versions of the .class files, including `module-info.class`
Copy link

@elharo elharo left a comment

Choose a reason for hiding this comment

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

Test failure might be flaky:

[FATAL] Non-resolvable parent POM for Could not transfer artifact org.sonatype.oss:oss-parent:pom:7 from/to google-maven-central ( PKIX path building failed: unable to find valid certification path to requested target and 'parent.relativePath' points at wrong local POM @, /home/travis/build/google/gson/pom.xml, line 6, column 11

Copy link
Contributor Author

Oh! I didn’t receive an email from Travis so I assumed it had passed :-(

Copy link

elharo commented Nov 2, 2019


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

Successfully merging this pull request may close these issues.

OSGi metadata on 2.8.6 requires Java 9 or greater
4 participants