jboss-deployment-structure.xml add JAXP exclusion jboss-deployment-structure.xml add JAXP exclusion xml xml

jboss-deployment-structure.xml add JAXP exclusion


Instead of trying to remove JARs from the Server's runtime.It is always advisable to exclude these JARs from your project at runtime.E.g. If you are using Maven for dependency management,then for this particular JAR in your pom.xml,you can just provide scope for this JAR as "provided".Provided scope indicates that this JAR will be used for compile time and at runtime it will be provided by runtime itself.


As you mentioned in your update, JBoss/Wildfly does ship its own JAXP implementation - Xalan (and Xerces). As such, it uses that implementation as it builds the classpath for your deployed application(s). You can override this behavior in your jboss-deployment-structure.xml file as follows:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">    <deployment>                    <exclusions>                        <module name="org.apache.xalan" />            <module name="org.apache.xerces" />         </exclusions>    </deployment></jboss-deployment-structure>