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
merged 3 commits into from Nov 4, 2019

Conversation

briandealwis
Copy link
Contributor

Fixes #1601 #1602

  • explicitly specifies Require-Capability: osgi.ee 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-ContactAddress: https://github.com/google/gson
 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-SymbolicName: com.google.gson
 Bundle-Vendor: Google Gson Project
-Bundle-Version: 2.8.6
+Bundle-Version: 2.8.7.201910311624
 Export-Package: com.google.gson;uses:="com.google.gson.reflect,com.googl
- e.gson.stream";version="2.8.6",com.google.gson.annotations;version="2.8
- .6",com.google.gson.reflect;version="2.8.6",com.google.gson.stream;vers
- ion="2.8.6"
+ e.gson.stream";version="2.8.7",com.google.gson.annotations;version="2.8
+ .7",com.google.gson.reflect;version="2.8.7",com.google.gson.stream;vers
+ ion="2.8.7"
 Import-Package: com.google.gson.annotations
-Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9.0))"
+Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.6))"
 Tool: Bnd-4.0.0.201805111645
 

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

@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 com.google.code.gson:gson-parent:2.8.7-SNAPSHOT: Could not transfer artifact org.sonatype.oss:oss-parent:pom:7 from/to google-maven-central (https://maven-central.storage-download.googleapis.com/repos/central/data/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at wrong local POM @ com.google.code.gson:gson-parent:2.8.7-SNAPSHOT, /home/travis/build/google/gson/pom.xml, line 6, column 11
@

@briandealwis
Copy link
Contributor Author

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

@elharo
Copy link
Contributor

elharo commented Nov 2, 2019

#1605

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

Successfully merging this pull request may close these issues.

OSGi metadata on 2.8.6 requires Java 9 or greater
4 participants