Skip to content

Incompatibility with Jackson 3/ Spring Boot 4 #183

Description

@Christian-Hovelmeyer

I'm trying to upgrade to Spring Boot 4 which ships with Jackson 3, but this snapshot-testing framework is written and complied against Jackson 2.

There are breaking changes in Jackson 3 as it is a major version update. Most importantly, namespaces changed from 'com.fasterxml' to 'tools'. Class ObjectMapper now resides in tools.jackson.databind. So most classes using Jackson 2 API (except for those using jackson-annotations only) shouldn't compile any longer.

There is a way to use snapshot-testing with SB4/J3 by using a compatibility-dependency as described in https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide#jackson-2-compatibility.
BUT as it reads there: "This module ships in a deprecated form and will be removed in a future release. It’s intended as a stop-gap for users that need more time to migrate to Jackson 3."

Without a version that is compatible with Spring Boot 4/ Jackson 3, this framework will not usable in the not so far future.

Activity

  1. NicklasWallgren commented on Jan 23, 2026

    @NicklasWallgren
    Contributor

    I've started adding support for jackson3, if anyone wants to pick it up;
    e46653b

    Spring boot 4 comes with JUnit 6, so we should probably include a module for that as well.

  2. NicklasWallgren commented on Jan 26, 2026

    @NicklasWallgren
    Contributor

    I created a fork with support for spring boot 4, and jackson 3.
    https://github.com/finoid/java-snapshot-testing

  3. jackmatt2 commented on Feb 22, 2026

    @jackmatt2
    Collaborator

    Hi, you are actually able to create your own serializer, no need to fork the entire repo. It was actually intended this way so that community members can maintain their own plugins separate from this project.

    You only need a compile time dependency on core.

    see docs here: https://github.com/origin-energy/java-snapshot-testing?tab=readme-ov-file#supplying-a-custom-snapshotserializer

  4. RainerGanss commented on Feb 23, 2026

    @RainerGanss

    @NicklasWallgren Your fork does not contain a license - so no one can use it. Could you maybe create a PR back to this repo with your changes?

  5. NicklasWallgren commented on Feb 25, 2026

    @NicklasWallgren
    Contributor

    @NicklasWallgren Your fork does not contain a license - so no one can use it. Could you maybe create a PR back to this repo with your changes?

    You can create a PR from this commit if you want;
    e46653b

  6. RainerGanss commented on Mar 3, 2026

    @RainerGanss

    @jackmatt2 As you pointed out, one can create a custom serializer. But since JSON is one, you already provide, I would love to see a jackson 3 version of that module. Could you take a look at the code from Nicklas? I tried to understand it but my gradle knowledge is pretty much non existing.

    I think I spottet, that only up to junit 5 is supported. Spring boot 4 also uses unit 6 as a new baseline. But that might be worth its one PR.

    Like @Christian-Hovelmeyer pointed out in the spring documentation, this jackson 2 backwards compatibility is temporally. I will happily test any PR in our system. For now, I got it to work with jackson 2, but I cant wait to be passed jackson 2.

    This jackson2/3 reminds me a lot of jaxb 2/3...

  7. Sboti03 commented on Apr 17, 2026

    @Sboti03
    Contributor

    I've just made a PR for that issue: #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions