How to exclude specific classes / packages from dependencies in JBoss EAP 7/6

Solution Unverified - Updated -


  • We are installing a war file. The war package needs to load a class from a jar in WEB-INF/lib instead of the one provided by the JBoss module.
  • For example, we would like to force JBoss to not load classes from com/sun/org/apache/xml/internal/security/transforms/implementations which is under the sun.jdk module by excluding it in WEB-INF/jboss-deployment-structure.xml and instead load this particular class from WAR provided WEB-INF/lib/xmlsec.jar.
  • Our web deployment MyWeb.war has dependency on another deployment AnotherDeployment.ear(AnotherDeployment.jar), how to declare dependency on AnotherDeployment.ear(AnotherDeployment.jar) , but exclude some classes / packages from it ?
  • I am trying to add <exclude path="com/abc"/> in my jboss-deployment-structure.xml in MyWeb.war, to exclude class from another dependency deployment, but that doesn't work.
  • How do I setup class exclusion or module dependency for a sub-deployment within ear ?


  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content