• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • jackson2-api-plugin
    • None
    • Jenkins ver. 2.107.3
      jackons-api-plugin 2.8.11.2

      Hello,

      are there in the near future any intentions to update the jackson2-api-plugin to the jackson-databind version 2.9?

      We would greatly need the new DeserializationFeature.FAIL_ON_TRAILING_TOKENS

      or maybe there is another way to get the 2.9 into a shared-library?

      Best,

      Ben

          [JENKINS-51322] Update jackson2-api to jackson-databind 2.9+

          Devin Nusbaum added a comment -

          I'd like to update the API plugin to 2.9.x, but want to do some testing to make sure there are no significant compatibility changes that will break plugins using the current API plugin and 2.8.x line, and I don't know when I will have time to do that.

          If you need 2.9.x urgently, you could shade the jackson dependencies in your plugin or copy them into your plugin sources using a different package name and then use that version in the plugin. (Not ideal, but it works)

          Devin Nusbaum added a comment - I'd like to update the API plugin to 2.9.x, but want to do some testing to make sure there are no significant compatibility changes that will break plugins using the current API plugin and 2.8.x line, and I don't know when I will have time to do that. If you need 2.9.x urgently, you could shade the jackson dependencies in your plugin or copy them into your plugin sources using a different package name and then use that version in the plugin. (Not ideal, but it works)

          Ben Herfurth added a comment -

          Heyho,

          I tried doing it like this in my pipeline:

          @Grab(group='com.fasterxml.jackson.core', module='jackson-core', version='2.9.5')
          @Grab(group='com.fasterxml.jackson.core', module='jackson-databind', version='2.9.5')
          
          import groovy.json.JsonOutput
          import groovy.json.JsonSlurper
          import com.fasterxml.jackson.databind.ObjectMapper
          import com.fasterxml.jackson.databind.DeserializationFeature
          
          node {
              ObjectMapper mapper = new ObjectMapper()
              mapper.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true)
              mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
          
          }

          But I am getting the 

          No such property: FAIL_ON_TRAILING_TOKENS for class: com.fasterxml.jackson.databind.DeserializationFeature

          error then.

          What am I doing wrong?

           

          Best Ben

          Ben Herfurth added a comment - Heyho, I tried doing it like this in my pipeline: @Grab(group= 'com.fasterxml.jackson.core' , module= 'jackson-core' , version= '2.9.5' ) @Grab(group= 'com.fasterxml.jackson.core' , module= 'jackson-databind' , version= '2.9.5' ) import groovy.json.JsonOutput import groovy.json.JsonSlurper import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.DeserializationFeature node { ObjectMapper mapper = new ObjectMapper() mapper.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true ) mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false ) } But I am getting the  No such property: FAIL_ON_TRAILING_TOKENS for class: com.fasterxml.jackson.databind.DeserializationFeature error then. What am I doing wrong?   Best Ben

          Devin Nusbaum added a comment -

          If you are trying to use Jackson as part of a pipeline, you should not do that and instead create a standalone Java program that you call in a shell step in the pipeline, which can have whatever dependencies you want.

          Devin Nusbaum added a comment - If you are trying to use Jackson as part of a pipeline, you should not do that and instead create a standalone Java program that you call in a shell step in the pipeline, which can have whatever dependencies you want.

          Ben Herfurth added a comment -

          Hey,

          I dont really want to do it in a pipeline, but in a shared-library I want to use in a pipeline.

          Was just testing it before in a pipeline.

          Best,

          Ben

          Ben Herfurth added a comment - Hey, I dont really want to do it in a pipeline, but in a shared-library I want to use in a pipeline. Was just testing it before in a pipeline. Best, Ben

          Hitesh Parwal added a comment -

          Hi
          For my project jackson2-api plugin is required by github-api plugin.
          Similarly github-api plugin is being used by other plugins. Hence can you suggest me a way to how to use jackson-databind version 2.9.4+ and as well how to remove these dependencies.

          Hitesh Parwal added a comment - Hi For my project jackson2-api plugin is required by github-api plugin. Similarly github-api plugin is being used by other plugins. Hence can you suggest me a way to how to use jackson-databind version 2.9.4+ and as well how to remove these dependencies.

            dnusbaum Devin Nusbaum
            bherfurth Ben Herfurth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: