J. Doe February 2016

Jackson dependency in maven and developing in eclipse with JBoss EAP 6.3/6.4

I'm using eclipse and developing some services with resteasy with jackson as json provider:

    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jaxrs</artifactId>
        <version>2.3.10.Final</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jackson-provider</artifactId>
        <version>2.3.10.Final</version>
        <scope>provided</scope>
    </dependency>

Those libs are actually supplied to the build path via JBoss EAP 6.1+ runtime. But I've to set some jackson specific options via a custom ObjectMapper. For this I added another dependency on jackson:

    <dependency>
        <artifactId>jackson-mapper-asl</artifactId>
        <groupId>org.codehaus.jackson</groupId>
        <version>1.9.9</version>
        <scope>provided</scope>
    </dependency>

Now this breaks my eclipse build because the server runtime only includes ee libs. Of course I can change the scope but that results in the artifact being included in the final war even if it's already packaged as a jboss module.

Answers


J. Doe February 2016

Updating to JBoss Tools to 4.3 and adding src/main/webapp/WEB-INF/jboss-deployment-structure.xml did the trick:

<jboss-deployment-structure>
   <deployment>
      <dependencies>
         <module name="org.jboss.resteasy.resteasy-jackson-provider" export="true" />
         <module name="org.codehaus.jackson.jackson-core-asl" export="true" />
         <module name="org.codehaus.jackson.jackson-mapper-asl" export="true" />        
      </dependencies>
   </deployment>
</jboss-deployment-structure>

Post Status

Asked in February 2016
Viewed 2,096 times
Voted 7
Answered 1 times

Search




Leave an answer