How to make Resteasy 2.3.6 use Jackson 2.+

痞子三分冷 提交于 2019-12-07 12:37:15

问题


IS there a way to make RestEasy use Jackson 2+ ? It seems that RestEasy Jackson provider uses Jackson 1.9.9 and it's still a case for ResetEasy 3.


回答1:


It occured to be quite simple. There are Jackson JAXRS providers in Jackson 2 already.

  • jackson-jaxrs-xml-provider
  • jackson-jaxrs-json-provider
  • jackson-jaxrs-smile-provider

So on the pom.xml

<dependency>
    <groupId>com.fasterxml.jackson.jaxrs</groupId>
    <artifactId>jackson-jaxrs-json-provider</artifactId>
    <version>2.2.2</version>
</dependency>

It's also good to exclude resteasy-jettison-provider to make sure you have no conflicts fo JSON handling.




回答2:


Unfortunately, it isn't possible to use Jackson 2.x with RESTEasy 2.x because the integration of Jackson 1.x is fairly tight.

However, RESTEasy supports Jackson 2.x as of version 3.0-beta-5 - please see this issue for details or do a repository search if you're using Maven.



来源:https://stackoverflow.com/questions/16188000/how-to-make-resteasy-2-3-6-use-jackson-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!