gson-fire icon indicating copy to clipboard operation
gson-fire copied to clipboard

Unresolved requirement: Import-Package: com.google.gson.internal.bind

Open ChaosMarc opened this issue 3 years ago • 2 comments

Hi,

when providing gson and gson-fire as modules in an osgi container gson-fire can't be resolved as it's referencing the internal package com.google.gson.internal.bind which is not exported by gson. Only by including both modules in every other module they're used in the problem disappears

I would love the get rid of all compileInclude statements and gson-fire is one of the last on my list I can't find a workaround for. Can you help me?

Thanks Marc

ChaosMarc avatar Mar 16 '21 22:03 ChaosMarc

pull request #55 will resolve this issue

sjsajj avatar Apr 29 '21 13:04 sjsajj

As sjsajj' fix sadly doesn't work I wanted to offer the workaround I'm using for now. I found https://github.com/stempler/bnd-platform with which I created my own gson-internal bundle which only exports the internal packages:

bundle("com.google.code.gson:gson:2.8.6") {
    bnd {
        symbolicName = 'com.google.code.gson-internal'
        bundleName = 'com.google.code.gson-internal'
        instruction 'Export-Package', 
				"com.google.gson.internal," +
                "com.google.gson.internal.bind," +
                "com.google.gson.internal.bind.util," +
                "com.google.gson.internal.reflect"
        instruction 'Private-Package', '*'
    }
}

I would nevertheless be happy about a "real" fix 😇 But I guess it's only possible by removing the usage of JsonTreeReader/JsonTreeWriter in gson-fire

ChaosMarc avatar May 01 '21 09:05 ChaosMarc