Skip to content

deprecated usage of com.fasterxml.jackson.databind.PropertyNamingStrategies #1280

@qwertiko

Description

@qwertiko

Problem:

got an exception in Jenkins which is using gitlab4j-api in it's gitlab-source-plugin
java.lang.NoSuchFieldError: Class com.fasterxml.jackson.databind.PropertyNamingStrategy does not have member field 'com.fasterxml.jackson.databind.PropertyNamingStrategy SNAKE_CASE'

Analysis

I think the root cause lies in this project since it has com.fasterxml.jackson.core:jackson-databind as dependency. gitlab4j-api uses PropertyNamingStrategy.SNAKE_CASE in

objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
But as seen in https://github.com/FasterXML/jackson-databind/blob/43c6527773493e82e066cbe3d1e05f0344f437f0/src/main/java/com/fasterxml/jackson/databind/PropertyNamingStrategy.java#L54 this attribute is deprecated and removed. After some digging I found out that this project uses version 2.18.0
api 'com.fasterxml.jackson.core:jackson-databind:2.18.0'

Suggested Resolution

  • downgrade version of jackson-databind to 2.10 since it is the current stable 2.x version
  • remove usage of PropertyNaimingStrategy.SNAKE_CASE

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions