Exactly same question here. Can anyone shine a light on that?
how does your war structure looks like? where is this extra library located?
In short, I simply want someone who can tell me how the path attribute is interpreted in the <resource-root /> element in jboss-deployment-structure.xml when in an EAR or a WAR.
The scenario is that I want to create a EAR which contains a few skinny WARs, with all the jar dependencies externalized (instead of putting them in the /lib within the EAR file). I want to explore what the options are, while using jboss-deployment-structure.xml in either the EAR or the WARs, if necessary.
Strickly speaking, my scenario is not exactly same as the original question. My apology.
I understand that I might be able to externalize those jars as a *module* somewhere in $JBOSS_HOME/modules. Can I put those jars at an arbitrary location and refer to them in the path attribute of the <resource-root /> element?
Hi John Wu,
Just try to create a "module" of all your Jars whihc you want to access from your EAR/WAR like following:
(How to create custom modules in JBossAS7 to load different slots of the jars ?) http://middlewaremagic.com/jboss/?p=1933
Now as you dont want to place your custom modules inside the "jboss-as-7.1.1.Final/modules" directory so in that case you have an option to create your own Module directory by editing the "standalone.sh" script as following... Just add your new module directory ( where you have custom module coontaining jars ) on the "JBOSS_MODULEPATH" as following
if [ "x$JBOSS_MODULEPATH" = "x" ]; then
yes that is different question
for more on that read https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7
but basicly you create custom modules in jboss_home\modules or createing your own module repository the way Jay pointed out.
and then you just configure dependancies via jboss-deployment-structure.xml or manifest.mf
Hi Jay/Tomaz, Great to know that I can create custom module repository. I may have time to try that next week.
But, the question remains not answered: how the path attribute is interpreted in the <resource-root /> element in jboss-deployment-structure.xml when in an EAR or a WAR?
Can the path attribute refer to a file/location outside the default/custom modules directory, such as "./../../relative/to/file" or "/absolute/path/to/directory"?
And, when it value is "my-lib.jar", where does JBoss look for the my-lib.jar?
I haven't tried yet, but maybe it's pointing to the [WILDFLY-FOLDER]/standalone/lib folder?