问题
I have this third party framework which comes with a huge set of dependent libraries, which by the way, have not yet been indexed in any Maven repository. I want to use this framework with some Web Apps, but for obvious reasons I don't want to put all those libraries under WEB-INF/lib, neither do I want just to place them all under server/default/lib to avoid mixing them with other local and third party libraries.
Is there some way under JBoss 4.2.2 or higher to specify a custom lib directory for certain Web Apps? It's possible and/or advisable to have something like server/default/lib/myAppLib?
Any suggestion on this regard?
回答1:
To my knowledge, you have three options:
Package you WARs in an EAR and move the library JARs out of WEB-INF/lib and place them in a
libfolder at the root of the EAR. No extra configuration required. This (non portable) solution is described in Configuring JBoss shared libs.Move the library JARs out of WEB-INF/lib and place them into
server/xxx/lib.Deploy the JARs in the
deploy/folder and disable WAR file class loader isolation.
I don't recommend option #3. Option #2 is what you don't want. This leaves us with option #1 (which is IMO the cleanest).
Related questions
- Jboss shared library
- In JBoss can I configure a “shared library” location?
回答2:
You can add the following entry in your server/default/conf/jboss-service.xml for putting your jars in server/default/myLibDir:
<classpath codebase="myLibDir" archives="*"/>
来源:https://stackoverflow.com/questions/3305661/jboss-custom-lib-directory