Our pom.xml file dependencies are not showing up in our jboss-deployment-structure.xml file
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6.x
Issue
- I have an application that has the following dependency in our pom.xml, but when I deploy our application, it comes up with a java.lang.ClassNotFoundException because there is no dependency on this module in my jboss-deployment-structure.xml file. How do we get this to be generated correctly?
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>2.3.10.Final-redhat-1</version>
<scope>provided</scope>
</dependency>
Resolution
Although they are both called "dependencies", there is no relationship between a Maven dependency in your pom.xml and a JBoss module dependency in your jboss-deployment-structure.xml. The pom file is correct, JBoss modules should be defined using
But, you also need to add the module dependency in your jboss-deployment-structure.xml as this is what causes the module to be made visible at runtime.
This article describes how to declare a dependency on a module:
https://access.redhat.com/solutions/341703
So in your instance, your jboss-deployment-structure.xml file would look something like this:
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
