战争之间的共享库

发布于 2024-12-27 04:07:21 字数 285 浏览 3 评论 0原文

我使用服务器 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

忆依然 2025-01-03 04:07:21

是的,如果您创建一个 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.

你丑哭了我 2025-01-03 04:07:21

为什么不将 .war 文件打包到 .ear 中,并将共享库添加到 EAR 项目的 lib 中?

Why don't you package your .war files into an .ear and add shared libraries to the lib of the EAR project?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文