Jackson Release: 2.0

General

Version 2.0 is the first new major update for Jackson since the official 1.0 release. It was released March 25, 2012, about 5 months after 1.9 release

Since it is a major versions upgrade, it will not be plug-in backwards compatible with old code; instead, code using it must be recompiled. This incompatibility is explicit and intentional in that all code will move to new Java packages, and Maven group id will change as well. The reason for this is to both allow co-existence of Jackson 1.x and 2.x versions (which will allow potentially smooth, and always safe, upgrade): it will prevent "hidden" breakage that might occur when doing jar-only upgrades, and make need for recompilation (and hopefully limited source changes) explicit.

But the exact scope of all changes is not yet defined. This page, then, tries to organize all plans for changes.

Since most of this page relate to bigger conceptual, packaging and development changes, parts of release notes are moved to separate pages:

Packaging, SCM, Build Changes

Changing Java packages

Jackson 1.x artifacts use following java packages:

These are divided in two separate groups: "core", which includes former 'core' and 'mapper' components; and then "other" that contains everything else.

For "core" group, changes are:

and others are be mapped as:

which also align with Maven group ids (see below). Idea is to generally use com.fasterxml.jackson as the ultimate root; but also divide functionality into sub-categories.

Extension modules (extensions that are registered using module interface) should use:

to use for other exte for non-module extension:

Changing Maven group id / artifact names

All Jackson 1.x Codehaus-originated artifacts use Maven group id of org.codehaus.jackson. Artifact names are as follows:

As mentioned above, Jackson 2.x uses Maven group and artifact ids that align with Java package name.

For core artifacts we will use group id com.fasterxml.jackson.core and artifact ids:

and for others use group ids using rules mentioned above:

Non-core packages should similar migrate to following Maven group ids as follows:

Refactoring "non-core" jars out of core

Moving from Codehaus to Github

All source code has been moved to Github: Issue tracking (Jira) will remain at Codehaus, at least for now, since it is a superior system compared to issue tracker GH has.

New projects for Jackson 2.0 are:

Replacing Ant build with Maven

Done -- all new artifacts are built using Maven; this simplifies deployment of artifacts significantly.

API changes, misc.

This section lists other API-level changes from Jackson 1.x, in no particular order; both completed (if not mentioned) and potential (where explicitly noted)

ObjectMapper

JsonSerializable

JsonSerializer now includes method 'serializeWithType()', which used to be in separate interface JsonSerializableWithType: by default, i

SerializationConfig.Feature, DeserializationConfig.Feature

Two main enumerations used for configuring serialization and deserialization settings have been refactored AND renamed, so that:

Usage is otherwise similar, with respect to ObjectMapper, but it is now possible to reconfigure ObjectMapper and ObjectWriter as well, using:

   ObjectWriter w = mapper.writer().with(SerializationFeature.INDENT_OUTPUT);
   ObjectReader r = mapper.reader().without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);

More Immutability

One of half-done good ideas with 1.x is to try to make certain objects fully immutable, in somewhat functional style. This is a useful goal mostly for making multi-threaded operation simpler, safer and potentially slightly faster.

Completed changes:

Some objects that we probably won't/can't make fully immutable:

Misc other API changes

Classes moved:

Classes removed:

Annotations moved:

Functional changes

"Any setter" vs ignored properties

In 1.x, any properties defines as ignored using @JsonIgnore will also be blocked from being set using so-called "any setters". This only affects properties not passed via regular deserialization accessors (fields, setters, constructor parameters).

In 2.0, this will not be done; only properties defined using @JsonIgnoredProperties are excluded, but @JsonIgnore will not have any effect on things passed to any-setters.

Ideas for 1.x Compatibility features

It should be possible to create a module that implements AnnotationIntrospector (similar to JacksonAnnotationIntrospector), but one that uses Jackson 1.x annotations (which have mostly same names, but are located in different Java package). This could be called, say, Jackson1xAnnotationIntrospector.


CategoryJackson

JacksonRelease20 (last edited 2012-08-07 02:21:13 by TatuSaloranta)

Copyright ©2009 FasterXML, LLC