Configure Wildfly to use resteasy from pom.xml, but not from Wildfly module

Viewed 740

Wildfly 10 is configured with resteasy modules of 3.0.19.Final version.

Several applications are deployed and rely on this version. Wildfly configuration is not under my control, so I cannot request to add a new module with an updated version.

I want to force the war application, exclude default resteasy modules from deployment:

<jboss-deployment-structure>
  <deployment>
    <exclusions>
      <module name="org.jboss.resteasy.resteasy-jaxrs"/>
    </exclusions>
  </deployment>
</jboss-deployment-structure>

Add compile-time dependency into the pom.xml:

<resteasy.version>3.1.4.Final</resteasy.version>
...
<dependency>
  <groupId>org.jboss.resteasy</groupId>
  <artifactId>resteasy-jaxrs</artifactId>
  <version>${resteasy.version}</version>
</dependency>
<dependency>
  <groupId>org.jboss.resteasy</groupId>
  <artifactId>resteasy-cdi</artifactId>
  <version>${resteasy.version}</version>
</dependency>
<dependency>
  <groupId>org.jboss.resteasy</groupId>
  <artifactId>resteasy-client</artifactId>
  <version>${resteasy.version}</version>
</dependency>

Now, when application is deployed, the jax rs configuration class, is not triggered:

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath(JAXRSConfiguration.APPLICATION_PATH)
public class JAXRSConfiguration extends Application {

As soon as I get rid of jboss-deployment-structure.xml file, switch version to the default one, jax rs application is triggered and application handles requests.

How can I get it solved?

I have found an JBoss Modules Suck, It’s Impossible To Use Custom Resteasy/JAX-RS Under JBoss 7 article. Hope that it has been changed in new versions of WildFly

0 Answers
Related