pivotal-cf / java-cfenv

Apache License 2.0
91 stars 56 forks source link

fix for update to json-io 4.19.2+ #260

Open mohadipe opened 3 months ago

mohadipe commented 3 months ago

Is your feature request related to a problem? Please describe.

If you use com.cedarsoftware:json-io in a version from 4.19.2+ and also use java-cfenv, this is no longer a compatible combination. This is because the package in json-io has changed from com.cedarsoftware.util.io.JsonObject to com.cedarsoftware.io.JsonObject.

Describe the solution you'd like

I have developed a possible solution for this situation.

update_json-io_to_4_19_10__-_fix_incompatible_change__package_for_JsonObject_has_changed.patch

I would be pleased if this correction were included. So that I can use new versions of json-io.

Describe alternatives you've considered

No response

Additional context

No response

jsnyder4 commented 3 months ago

While you won't be able to change the version of json-io that java-cfenv is using, you can use json-io 4.19.11. The packing as been changed so that nothing interferes with the old packaging that java-cfenv is using.

That being said, the devs of java-cfenv are trying to use a gradle plugin that shades/relocates json-io to another package for the cfenv usage. However, that plugin doesn't seem to work properly. You can see the plugin usage here.

mohadipe commented 3 months ago

While you won't be able to change the version of json-io that java-cfenv is using, you can use json-io 4.19.11. The packing as been changed so that nothing interferes with the old packaging that java-cfenv is using.

I do not understand your suggestion because json-io 4.19.11 is still incompatible with java-cfenv-boot 3.1.5. The class JsonObject is not found at runtime.

That being said, the devs of java-cfenv are trying to use a gradle plugin that shades/relocates json-io to another package for the cfenv usage. However, that plugin doesn't seem to work properly. You can see the plugin usage here.

Why did you try to relocate the package instead of fixing the imports?

jsnyder4 commented 3 months ago

I'm not a java-cfenv author, just a guy familiar with the problem and trying to help you out.

mohadipe commented 3 months ago

Thank you for your help.

Why did you try to relocate the package instead of fixing the imports?

I thought you might know that

n-shaw commented 3 months ago

@mohadipe, please take a look at issue#261. That is what caused problems for you and other json-io users. I believe the reason json-io shifted the package was specifically to address the issue with java-cfenv not shading the complete json-io namespace.

Once issue#261 is fixed, this enhancement is unnecessary.