Has this project moved? I can't seem to find the latest changes. Latest release in maven central is 3.0.4-jdk17.
This issue relates to version 3.0.4-jdk17.
In FSTConfiguration class android configuration uses Class.forName("com.google.gson.internal.LinkedTreeMap") and Class.forName("com.google.gson.internal.LinkedHashTreeMap").
maven-bundle-plugin probably notices these and adds "com.google.gson.internal" as an Import-Package in MANIFEST.MF. Manifest also contains "DynamicImport-Package: *" so this import is not necessary. Other option could be to declare the import optional, since it is only for android.
Fix could be to change pom.xml line:
<Import-Package>*</Import-Package>
to
<Import-Package>!com.google.gson.internal.*,*</Import-Package>
or if you would like to make it optional:
<Import-Package>com.google.gson.internal.*;resolution=optional,*</Import-Package>
Also maven-bundle-plugin shouldn't be a compile dependency and should be removed from "dependencies" element. (Separate issue #328)
EDIT: Added .* to the exclusion example and added the optional example. Also cleaned up the text a bit.
Has this project moved? I can't seem to find the latest changes. Latest release in maven central is 3.0.4-jdk17.
This issue relates to version 3.0.4-jdk17.
In FSTConfiguration class android configuration uses Class.forName("com.google.gson.internal.LinkedTreeMap") and Class.forName("com.google.gson.internal.LinkedHashTreeMap"). maven-bundle-plugin probably notices these and adds "com.google.gson.internal" as an Import-Package in MANIFEST.MF. Manifest also contains "DynamicImport-Package: *" so this import is not necessary. Other option could be to declare the import optional, since it is only for android.
Fix could be to change pom.xml line:
<Import-Package>*</Import-Package>
to<Import-Package>!com.google.gson.internal.*,*</Import-Package>
or if you would like to make it optional:
<Import-Package>com.google.gson.internal.*;resolution=optional,*</Import-Package>
Also maven-bundle-plugin shouldn't be a compile dependency and should be removed from "dependencies" element. (Separate issue #328)
EDIT: Added .* to the exclusion example and added the optional example. Also cleaned up the text a bit.