战争之间的共享库
我使用服务器 glassfish 和 Maven,我部署了很多战争,每个战争都有自己的库。他们中的许多人都使用相同的库,我想将这些库从战争中提取出来。我尝试将它们放在服务器的文件夹 /lib 中,并将提供的范围放在战争的依赖项上,但这不能正常工作,因为服务器要求更多的库,而我对其他战争有问题。我也尝试使用范围系统,但不起作用。
我在互联网上寻找解决方案,只发现了瘦战争。
有办法做到吗?
如果我将使用公共库创建一个耳朵,我可以从战争中引用它们(或将战争包装在另一只耳朵中)吗?
非常感谢你。
I use server glassfish and maven, I have many wars deploy and each one have their libraries. Many of them use same libraries and I want to extract this libraries out of the war. I try to put them in a folder /lib of the server and put provided scope on the dependency of the war, but this don't work fine because the server ask for more libraries and i have problem with other wars. Also I try with scope system but doesn´t work.
I was searching a solution in Internet and only find skinny wars.
¿There are a way to do it?
If I will create a ear with the commoms libraries could I referenced them from a war (or packaging the war in other ear)?
Thanks you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,如果您创建一个 EAR,但将 WAR 库放入其中,它们可以引用 EAR 的 lib 文件夹中的任何库。
Yes, if you create an EAR and but the WAR libraries into it, they could reference any library in the EAR's lib folder.
为什么不将
.war
文件打包到.ear
中,并将共享库添加到 EAR 项目的lib
中?Why don't you package your
.war
files into an.ear
and add shared libraries to thelib
of the EAR project?