Exclude Jackson Module in Wildfly

Due to some business need I badly wanted to exclude Jackson module from my application running in Wildfly 10.1 version. The standard way to exclude is to add following in the jboss-deployment-structure.xml file of my application,


 <exclusions>
  <module name="com.fasterxml.jackson.core.jackson-databind"/>
  <module name="com.fasterxml.jackson.core.jackson-core"/>
  <module name="com.fasterxml.jackson.core.jackson-annotations"/>
  <module name="com.fasterxml.jackson.datatype.jackson-datatype-jdk8"/>
  <module name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310"/>
  <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider"/>
 </exclusions>

This will not exclude Jackson as Wildfly has internal module called resteasy-jackson2-provider which has added dependencies with Jackson libraries internally (Watch for export=”true”). Hence in addition to the above list of exclusion, you need to exclude following module as well.

  <module name="org.jboss.resteasy.resteasy-jackson2-provider"/>

In our case we were not using rest easy in my application, so we were good to exclude resteasy.

Leave a Reply

Your email address will not be published.

WP2Social Auto Publish Powered By : XYZScripts.com