JBoss Custom lib directory

余生颓废 提交于 2019-12-08 08:55:45

问题


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:

  1. Package you WARs in an EAR and move the library JARs out of WEB-INF/lib and place them in a lib folder at the root of the EAR. No extra configuration required. This (non portable) solution is described in Configuring JBoss shared libs.

  2. Move the library JARs out of WEB-INF/lib and place them into server/xxx/lib.

  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!