Hi @nvanbelle,
This is the minimal jboss-deployment-structure.xml
that works for me with your example:
Now, if you want to use resteasy-jackson2-provider nonetheless, I think one of these should work (haven’t tried them, though):
Variant 1
Declares a custom module deployment.jackson2-provider
that mirrors jackson but does not re-export jackson. I think this provider would ignore any custom Jackson annotations in your classes since the deployment.jackson2-provider
module still uses its own Jackson dependencies.
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
</exclusions>
<dependencies>
<module name="com.fasterxml.jackson.core.jackson-databind" slot="2.5.3" />
<module name="deployment.jackson2-provider" />
</dependencies>
</deployment>
<module name="deployment.jackson2-provider" >
<dependencies>
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
</dependencies>
</module>
</jboss-deployment-structure>
Variant 2
Declares a custom module deployment.jackson2-provider
that excludes the Jackson classes from the
org.jboss.resteasy.resteasy-jackson2-provider
dependency and imports the 2.5.3 version instead.
I’m a skeptical that this works, i.e. if the 2.5.3 Jackson classes become visible to the imported Resteasy Jackson classes. If this does not work,
an alternative approach would be creating a full copy of the org.jboss.resteasy.resteasy-jackson2-provider
module in a custom slot, use a different
Jackson version there and import that in your application.
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
</exclusions>
<dependencies>
<module name="com.fasterxml.jackson.core.jackson-databind" slot="2.5.3" />
<module name="deployment.jackson2-provider" />
</dependencies>
</deployment>
<module name="deployment.jackson2-provider" >
<dependencies>
<module name="org.jboss.resteasy.resteasy-jackson2-provider">
<imports>
<exclude path="com/fasterxml/jackson/**" />
</imports>
</module>
<module name="com.fasterxml.jackson.core.jackson-databind" slot="2.5.3" />
<module name="com.fasterxml.jackson.core.jackson-annotations" slot="2.5.3"/>
<module name="com.fasterxml.jackson.core.jackson-core" slot="2.5.3"/>
</dependencies>
</module>
</jboss-deployment-structure>
I hope that helps.
Cheers,
Thorben