Spring-boot: Rename jackson.version property

Created on 6 Apr 2018  路  9Comments  路  Source: spring-projects/spring-boot

I have just upgraded my project to Spring Platform Brussels-SR8, which uses Spring Boot 1.5.11. The project cannot be built because Maven fails with:

Failure to find com.fasterxml.jackson.core:jackson-databind:jar:2.8.11.20180217

It is caused by spring-boot-dependencies-1.5.11.RELEASE.pom which contains line

2.8.11.20180217

that specifies a version unavailable in public Maven repository, as can be seen at http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/

There is, however, version 2.8.11.1 available dated 2018-02-11, and version 2.9.5 dated 2018-03-26.

invalid

All 9 comments

The Jackson version is used to identify a specific version of Jackson's bom. For the failure that you're seeing to occur, you must be using ${jackson.version} to define the version of jackson-databind.

I ran into a similar issue and I believe it is related to Spring Boot defining the jackson.version property which is overriding the property in the jackson-bom artifact. When they differ, it causes this error. To work around, I set two properties:

    <jackson.version>2.8.11</jackson.version>
    <jackson-bom.version>2.8.11.20180217</jackson-bom.version>

First, I override the jackson.version property with the value found in the target com.fasterxml.jackson:jackson-bom version. Then, I override Spring Boot's dependency management with jackson-bom.version:

      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${jackson-bom.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>

Would it be possible to change Spring Boot to use the property jackson-bom.version or at least something that is not used by jackson-bom internally. Then, I can remove all my overrides.

@seanmmills That's an interesting problem. I'm not sure if we'll be able to rename that property in 2.0 because it might break back compatibility.

@philwebb, perhaps it may be more appropriate to ask Jackson to change the internal property since jackson.version is likely to be used by other projects as well. I created issue https://github.com/FasterXML/jackson-bom/issues/14.

this "change" broke backwards compatibility in 1.5... sorting the red out of our upgrade now.

... I know platform is going away, what I don't know is what's going to happen to its reference docs, in this case I'd say they are misleading and potentially inaccurate. I hope that the reference doc with all the versions sticks around though, but gets more detailed about what properties can be set and what they're for.

defining the jackson.version property which is overriding the property in the jackson-bom artifact

I don鈥檛 understand how this can be the case. As far as I know, properties in an imported bom (which is what the Jackson bom is in this case) cannot be overridden.

That is correct. Sorry I meant to add that exact same comment and I forgot.

@wilkinsona and @snicoll, thank you! I found the root of my problem. Some of our sub-modules had Jackson dependencies that included the ${jackson.version} which was causing the "version 2.8.11.20180217 not found" issues. After removing these references from all sub-modules, everything works perfectly.

Thanks for the feedback.

Was this page helpful?
0 / 5 - 0 ratings