Blebleskeble
Blebleskeble

Reputation: 55

Adding of external jar file into classpath for jBoss 7

I would like to include external jar files into classpath for all configurations of jBoss7. Is there any way to do this without moving my files somewhere into jboss lib directories? Or better - is there any way to include all jar files in some external directory?

Upvotes: 4

Views: 27844

Answers (2)

Roman C
Roman C

Reputation: 1

There's a directory called modules where you can put your jars. But to know how to do that you should read this guide. You may also create a global module that is accessible to all deployments. Look at this doc.

Upvotes: 2

NimChimpsky
NimChimpsky

Reputation: 47290

No answer actually outlines exactly what to do here so here goes.

In your jboss-deployment-structure.xml file, which should be in webapp/WEB-INF you need to add the module reference :

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
    <deployment>
        <dependencies>
            <module name="javaee.api">
                <imports>
                    <exclude path="org/apache/xml/security/**" />
                </imports>
            </module>
            <module name="com.sun.xml.bind" slot="main" />
            <module name="com.mycompany.mypackage" slot="1_0" />
            <module name="com.oracle.ojdbc14" slot="main" />    
        </dependencies>
    </deployment>
</jboss-deployment-structure>

then copy the jar file this dir :

C:\[JBoss-Home]\modules\com\mycompany\mypackage\1_0

Upvotes: 3

Related Questions