如何使用 warbler 将 jruby-jars 和 jruby-rack 添加到类路径中?

发布于 2024-08-27 22:08:56 字数 328 浏览 3 评论 0原文

我一直在阅读 warbler 源代码,但我无法弄清楚 jruby-jar 和 jruby-rack jar 是如何最终出现在 servlet 类路径上的?

Warbler 似乎正在将它们复制到 web-inf/gems/gems//lib/.jar 中,但它们不在类路径上。

我猜如果我把它们放在我的 ruby​​ apps lib/ 文件夹中,它们将被复制到 web-inf/lib 中,一切都会好起来,但是,在 war 文件中有 2 个 jar 副本似乎很奇怪,是那是我应该做的吗?

I've been reading through the warbler source code, and I can't figure out how the jruby-jars and jruby-rack jars are meant to end up on the servlet classpath?

It seems warbler is copying them into web-inf/gems/gems/<gemname>/lib/<jarname>.jar but they are not on the classpath.

I'm guessing that if I put them in my ruby apps lib/ folder they would be copied to web-inf/lib and all would be well, however, it seems odd to have 2 copies of the jar in the war file, is that what I am meant to do?

Ben

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

若水般的淡然安静女子 2024-09-03 22:08:56

应将它们复制到 WEB-INF/lib/.jar 中。用于定位 jar 的代码位于:

http ://github.com/nicksieger/warbler/blob/master/lib/warbler/config.rb#L216-220

将它们复制到 WEB-INF/lib 的代码在这里:

http://github.com/nicksieger/warbler/blob/master /lib/warbler/war.rb#L68-70

如果您看到其他内容,那么这是一个错误。另外,您不必显式声明对 JRuby jar 文件 gems 的依赖关系。

They should be copied into WEB-INF/lib/.jar. The code for locating the jars is here:

http://github.com/nicksieger/warbler/blob/master/lib/warbler/config.rb#L216-220

And the code that copies them into WEB-INF/lib is here:

http://github.com/nicksieger/warbler/blob/master/lib/warbler/war.rb#L68-70

If you're seeing something else, then it's a bug. Also, you shouldn't have to explicitly state dependencies on the JRuby jar file gems.

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