tovarichML
tovarichML

Reputation: 129

Choose a library version between Jboss modules and project dependencies

I'm trying to make a sign operation with a XML file. In this process, I use the xmlSec 1.5 library. If I run the code in a local test the process finishes successfully. However, if I deploy the code in a war in a Jboss 7.1, my dependency with xmlSec 1.5 is override by Jboss by its module dependency "xmlsec-2.0.8.redhat-1", and the sign process fails. For client's petition, I can exclude the xmlsec Jboss module, but I cannot use it to sign. So, the problem is: how could I specify a given library version to be used only in a part of the code?.

In this case, the path of both dependencies are the same: org.apache.santuario, so, I cannot use it in order to specify the library.

I'm trying to use a provider for signing, but, again, Jboss override my xmlsec-1.5 security provider for its xmlsec-2.0.8 security provider. There exists some way to instanciate a provider and adds it to the set of java providers in order to replace the Jboss one?

Upvotes: 0

Views: 961

Answers (1)

Pravin
Pravin

Reputation: 155

You can exclude the JBoss provided dependency using jboss-deployment-structure.xml file which you need to place under the WEB-INF directory of your war. You have to specify the exclusion dependencies something like below.

<jboss-deployment-structure>  
 <deployment>  
    <exclusions>  
        <module name="$LIBRARY_OR_MODULE_YOU_WANT_TO_EXCLUDE"/>  
    </exclusions>  
</deployment>  

e.g. <module name="org.apache.santuario.xmlsec"/>

Upvotes: 0

Related Questions