Configuring ObjectMapper with gradle

934 views
Skip to first unread message

Thom Hehl

unread,
Jul 13, 2015, 12:06:24 PM7/13/15
to jackso...@googlegroups.com
I am using gradle for my first project and am trying to bring down the correct jackson. Here is the entry from my build.gradle file.

    compile("com.fasterxml.jackson.core:jackson-core:2.5.4")

I run the build and try to reference ObjectMapper and eclipse can't find it. I went to the core library and it doesn't seem to contain ObjectMapper.

Obviously, I'm running from out of date docs, but no idea how to proceed.

Thanks.

Tatu Saloranta

unread,
Jul 13, 2015, 1:07:09 PM7/13/15
to jackso...@googlegroups.com
Ah. jackson-core contains streaming parser (JsonParser), generator (JsonGenerator) and factory to create those (JsonFactory). It is a small lib to allow low-level usage with minimal overhead.

ObjectMapper comes from `jackson-databind`, which depends on `jackson-core` and `jackson-annotations`.
So you need to add `jackson-databind` at least, `jackson-annotations` should be pulled in as a dependency (although you may want to be explicit to ensure identical minor version).

Hope this helps,

-+ Tatu +-


--
You received this message because you are subscribed to the Google Groups "jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user...@googlegroups.com.
To post to this group, send email to jackso...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages