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 2.9.1 includes old version of jackson-core and jackson-annotations #1777

Closed
codingsince1985 opened this Issue Sep 27, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@codingsince1985

codingsince1985 commented Sep 27, 2017

[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.1:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile

Problem caused will be attached later.
Workaround is to explicitly declare latest dependencies to override them.

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.9.1</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.9.1</version>
        </dependency>
@cowtowncoder

This comment has been minimized.

Member

cowtowncoder commented Sep 27, 2017

I don't think this is true. As per Mvnrepository:

http://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind/2.9.1 

declared dependencies are for jackson-core of 2.9.1 and jackson-annotations of 2.9.0
(latter is intentional -- no changes in patch releases -- 2.9.0/2.9.1/..../2.9.N will be identical).

So perhaps something else is declaring old versions?

@codingsince1985

This comment has been minimized.

codingsince1985 commented Sep 27, 2017

It turn out that my project has spring-boot-starter-parent as parent, as suggested by Spring Boot document. This parent defines <jackson.version>2.8.10</jackson.version>, which confuses jackson-databind:2.9.1.
Is there a better way to ignore it, or I have to override them myself if I use Spring Boot?

@cowtowncoder

This comment has been minimized.

Member

cowtowncoder commented Sep 28, 2017

@codingsince1985 Ah. Hmmh. That makes more sense. Interesting... there's some unfortunate interaction there between definition of jackson.version by jackson-parent and spring boot.
I don't know what would be the best way to resolve that.

One thing that might help would be to use jackson-bom project:

http://mvnrepository.com/artifact/com.fasterxml.jackson/jackson-bom

either by importing it (it's a pom artifact designed to provide consistent set of versions), or using as parent pom. Either way would give you dependencyManagement section with versions defined for all official jackson components. It also does set jackson.version consistently.

@codingsince1985

This comment has been minimized.

codingsince1985 commented Sep 28, 2017

@cowtowncoder, changing parent pom is not an option in my case. I'll import jackson-bom as a dependency later and let you know.

@cowtowncoder

This comment has been minimized.

Member

cowtowncoder commented Sep 28, 2017

Understood, changing parent is often more work and importing is better option for bom-style things anyway. I hope it helps; main concern is probably how Maven chooses to resolve conflicting version info.

@codingsince1985

This comment has been minimized.

codingsince1985 commented Sep 28, 2017

@cowtowncoder, this is to confirm importing jackson-bom solves the issue.

@cowtowncoder

This comment has been minimized.

Member

cowtowncoder commented Sep 28, 2017

@codingsince1985 Ok good, thank you for verifying it.

@hzsbrave

This comment has been minimized.

hzsbrave commented May 11, 2018

<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.9.4</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.9.4</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.9.4</version> </dependency>
add both dependency

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