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

jackson-databind should not be optional/provided dependency for Properties, YAML modules #184

Closed
jvanzyl opened this issue Mar 23, 2020 · 2 comments
Labels
Properties Issue related to (Java) Properties format backend yaml Issue related to YAML format backend
Milestone

Comments

@jvanzyl
Copy link

jvanzyl commented Mar 23, 2020

In the following pom.xml for jackson-dataformats-properties:

https://github.com/FasterXML/jackson-dataformats-text/blob/master/properties/pom.xml#L23

jackson-databind is not optional, it is required for the JavaPropsMapper to work correctly.

@petroav
Copy link

petroav commented Mar 23, 2020

To provide some more details on the issue: I have jackson-dataformat-properties as a dependency and then attempt to call new JavaPropsMapper().readValue(file, MyClass.class) but receive a compiler error:

error: cannot access ObjectMapper class file for com.fasterxml.jackson.databind.ObjectMapper not found

The readValue() method is defined in ObjectMapper, which is the super class of JavaPropsMapper. ObjectMapper is defined in jackson-databind. If I add jackson-databind as an explicit dependency I get an error that the dependency is unused. I'd rather not turn off the check so for now I've added dummy usage of a class from jackson-databind.

@cowtowncoder
Copy link
Member

Ah yes. For some of dataformats it used to be fully optional (mostly binary codecs), but with 2.10, and especially for Properties, it should be regular full dependency. Will fix for 2.10 and later; check that same is done for CSV and YAML as well -- starting with 2.10, every format has matching XxxMapper to support builder pattern so it can not be optional dependency.

@cowtowncoder cowtowncoder added this to the 2.10.4 milestone Mar 23, 2020
@cowtowncoder cowtowncoder changed the title In jackson-dataformats-properties, jackson-databind is incorrectly marked as provided jackson-databind should not be optional/provided dependency for Properties, YAML modules Mar 23, 2020
@cowtowncoder cowtowncoder added Properties Issue related to (Java) Properties format backend yaml Issue related to YAML format backend labels Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Properties Issue related to (Java) Properties format backend yaml Issue related to YAML format backend
Projects
None yet
Development

No branches or pull requests

3 participants