Jackson Project Home @github
This is the home page of the Jackson Project.
What is New?
- Mar 12, 2024: Jackson 2.17(.0) (latest stable) released
- Feb 19, 2024: Another OSTIF/AdaLogics Security Audit -- on jackson-dataformat-xxx's and jackson-datatype-xxx's -- released: https://ostif.org/dataformatsdatatypes-audit-complete/
- Dec 17, 2023: contributing/Jackson Coding Style Guide
- Nov 15, 2023: Jackson 2.16 released
- Apr 23, 2023: Jackson 2.15 released
- Nov 5, 2022: Jackson 2.14 released
- Nov 2, 2022: AdaLogics Security Audit for Jackson released -- see Document/Reports
- Sep 30, 2021: Jackson 2.13 released
- Oct 1, 2020: Jackson participates in Hacktoberfest2020 and we have a Jackson/Hacktoberfest repo too!
- Oct 9, 2020: Added Contributing
(note: for up-to-date release info, see Jackson Releases)
What is Jackson?
Jackson has been known as "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".
More than that, Jackson is a suite of data-processing tools for Java (and the JVM platform), including the flagship streaming JSON parser / generator library, matching data-binding library (POJOs to and from JSON) and additional data format modules to process data encoded in Avro, BSON, CBOR, CSV, Smile, (Java) Properties, Protobuf, TOML, XML or YAML; and even the large set of data format modules to support data types of widely used data types such as Guava, Joda, PCollections and many, many more (see below).
While the actual core components live under their own projects -- including the three core packages (streaming, databind, annotations); data format libraries; data type libraries; JAX-RS provider; and a miscellaneous set of other extension modules -- this project act as the central hub for linking all the pieces together.
A good companion to this README is the Jackson Project FAQ.
Actively developed versions
Jackson suite has two major versions: 1.x is deprecated and no versions are released; 2.x is the actively developed version. These two major versions use different Java packages and Maven artifact ids, so they are not mutually compatible, but can peacefully co-exist: a project can depend on both Jackson 1.x and 2.x, without conflicts. This is by design and was chosen as the strategy to allow smoother migration from 1.x to 2.x.
The latest stable versions from these branches are:
- 2.17.2, released on 05-Jul-2024
- 2.16.2 is the latest patch from previous stable branch
- 1.9.13, released 14-Jul-2013
Recommended way to use Jackson is through Maven repositories; releases are made to Central Maven Repository (CMR). Individual projects' wiki pages sometimes also contain direct download links, pointing to CMR.
Release notes for 2.x releases are found from Jackson Releases page.
Active Jackson projects
Most projects listed below are lead by Jackson development team; but some by other at-large Jackson community members. We try to keep versioning of modules compatible to reduce confusion regarding which versions work together.
Core modules
Core modules are the foundation on which extensions (modules) build upon. There are 3 such modules currently (as of Jackson 2.x):
- Streaming (docs) ("jackson-core") defines low-level streaming API, and includes JSON-specific implementations
- Annotations (docs) ("jackson-annotations") contains standard Jackson annotations
- Databind (docs) ("jackson-databind") implements data-binding (and object serialization) support on
streaming
package; it depends both onstreaming
andannotations
packages
Third-party datatype modules
These extensions are plug-in Jackson Module
s (registered with ObjectMapper.registerModule()
),
and add support for datatypes of various commonly used Java libraries, by adding
serializers and deserializers so that Jackson databind
package (ObjectMapper
/ ObjectReader
/ ObjectWriter
) can read and write these types.
Datatype modules directly maintained by Jackson team are under the following Github repositories:
- Standard Collections datatype modules:
- jackson-datatype-eclipse-collections: support for Eclipse Collections (NEW in Jackson 2.10!)
- jackson-datatype-guava: support for many of Guava datatypes
- jackson-datatype-hppc: support for High-Performance Primitive Containers containers
- jackson-datatype-pcollections: support for PCollections datatypes (since Jackson 2.7)
- Hibernate: support for Hibernate features (lazy-loading, proxies)
- Java 8 Modules: support or JDK 8 features and datatypes through 3 separate modules
jackson-module-parameter-names
: Module that adds support for using a new JDK8 feature, ability to access names of constructor and method parameters, to allow omitting@JsonProperty
.jackson-datatype-jsr310
: support for "Java 8 Dates" (ones added in JDK 8)- Also, for pre-Java8 users can use one of alternate pre-Java8 backports:
jackson-datatype-jdk8
: support for JDK 8 data types other than date/time types, includingOptional
- Joda datatypes:
- jackson-datatype-joda: support for types of Joda-Time date/time library datatypes
- jackson-datatype-joda-money: support types of Joda-Money datatypes (
Money
,CurrencyUnit
)
- JSON-P ("json processing"): two datatype modules for "old" (
javax.json
) and "new" (jakarta.json
):- jackson-datatype-jakarta-jsonp: support for "new" JSON-P types in
jakarta.json
(added in Jackson 2.12.2) - jackson-datatype-jsr353: support for "old" JSON-P types in
javax.json
- jackson-datatype-jakarta-jsonp: support for "new" JSON-P types in
- jackson-datatype-json-org: support for org.json library types like
JSONObject
,JSONArray
In addition, we are aware of additional modules that are not directly maintained by core Jackson team:
- jackson-datatype-bolts support for reading/writing types defined by Yandex Bolts collection types (Functional Programming inspired immutable collections)
- jackson-datatype-commons-lang3 for types of Apache Commons Lang v3
- jackson-datatype-money for "Java Money", see javax.money
- vavr-jackson for VAVR support (Feature-rich & self-contained functional programming in Java™ 8 and above)
- jackson-datatype-json-lib for supporting types defined by "net.sf.json" library (aka "json-lib")
- jackson-datatype-jts (JTS Geometry) for GeoJSON support
- jackson-lombok for better support of Lombok classes
- jackson-datatype-mongo for MongoDB types
- NOTE: there are a few alternatives to handling MongoDB datatypes
- jackson-module-objectify for datatypes of Objectify
- jackson-datatype-protobuf for handling datatypes defined by the standard Java protobuf library, developed by HubSpot
- NOTE! This is different from
jackson-dataformat-protobuf
which adds support for encoding/decoding protobuf content but which does NOT depend on standard Java protobuf library
- NOTE! This is different from
- TinyTypes includes Jackson module (group id
com.github.caligin.tinytypes
, artifacttinytypes-jackson
) - jackson-datatype-vertx for reading/writing Vert.x
org.vertx.java.core.json.JsonObject
objects (repackagedorg.json
node types)
Providers for JAX-RS
Jackson JAX-RS Providers has handlers to add dataformat
support for JAX-RS implementations (like Jersey, RESTeasy, CXF).
Providers implement MessageBodyReader
and MessageBodyWriter
.
Supported formats currently include JSON
, Smile
, XML
, YAML
and CBOR
.
Data format modules
Data format modules offer support for data formats other than JSON.
Most of them simply implement streaming
API abstractions, so that databinding component can be used as is; some offer (and few require) additional databind
level functionality for handling things like schemas.
Currently following data format modules are fully usable and supported (version number in parenthesis, if included, is the first Jackson 2.x version to include module; if missing, included from 2.0)
- Avro: supports Avro data format, with
streaming
implementation plus additionaldatabind
-level support for Avro Schemas - CBOR: supports CBOR data format (a binary JSON variant).
- CSV: supports Comma-separated values format --
streaming
api, with optional conveniencedatabind
additions - Ion (2.9): support for Amazon Ion binary data format (similar to CBOR, Smile, i.e. binary JSON - like)
- (Java) Properties (2.8): creating nested structure out of implied notation (dotted by default, configurable), flattening similarly on serialization
- Protobuf (2.6): supported similar to
Avro
- Smile: supports Smile (binary JSON) -- 100% API/logical model compatible via
streaming
API, no changes fordatabind
- TOML: (NEW in upcoming 2.13) supports TOML, supported with both
streaming
anddatabind
implementations - XML: supports XML; provides both
streaming
anddatabind
implementations. Similar to JAXB' "code-first" mode (no support for "XML Schema first", but can use JAXB beans) - YAML: supports YAML, which being similar to JSON is fully supported with simple
streaming
implementation
There are also other data format modules, provided by developers outside Jackson core team:
- BEncode: support for reading/writing BEncode (BitTorrent format) encoded data
- bson4jackson: adds support for BSON data format (by Mongo project).
- Implemented as full streaming implementation, which allows full access (streaming, data-binding, tree-model)
- Also see [MongoJack] library below; while not a dataformat module, it allows access to BSON data as well.
- EXIficient supports Efficient XML Interchange
- jackson-dataformat-msgpack adds support MessagePack (aka
MsgPack
) format- Implemented as full streaming implementation, which allows full access (streaming, data-binding, tree-model)
- HOCON: experimental, partial implementation to support HOCON format -- work in progress
- Rison: Jackson backend to support Rison
JVM Language modules
- Kotlin to handle native types of Kotlin
- Scala to handle native Scala types (including but not limited to Scala collection/map types, case classes)
- Currently (October 2022) Scala 2.11, 2.12, 2.13 and 3 are supported (2.9 was supported up to Jackson 2.3 and 2.10 up to Jackson 2.11)
Support for Schemas
Jackson annotations define intended properties and expected handling for POJOs, and in addition to Jackson itself using this for reading/writing JSON and other formats, it also allows generation of external schemas. Some of this functionality is included in above-mentioned data-format extensions; but there are also many stand-alone Schema tools, such as:
JSON Schema
- Build tool plug-ins
- Ant Task for JSON Schema Generation: Generate JSON